dmaengine: hisilicon: Use struct_size() in devm_kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Wed, 17 Jun 2020 21:11:35 +0000 (16:11 -0500)
committerVinod Koul <vkoul@kernel.org>
Wed, 24 Jun 2020 05:56:23 +0000 (11:26 +0530)
commit999a32efed09d724c426568731c5691233d3a680
tree47624246be291b7d2636f84d84f624162c2b583b
parent09c16edc5a3dc2bcfa8a93ddbeec59793e3b414d
dmaengine: hisilicon: Use struct_size() in devm_kzalloc()

Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes.

This code was detected with the help of Coccinelle and, audited and
fixed manually.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
Link: https://lore.kernel.org/r/20200617211135.GA8660@embeddedor
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/hisi_dma.c