projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d98793b
)
dmaengine: stm32-mdma: Use struct_size() in kzalloc()
author
Gustavo A. R. Silva
<gustavoars@kernel.org>
Thu, 8 Oct 2020 14:18:28 +0000
(09:18 -0500)
committer
Vinod Koul
<vkoul@kernel.org>
Fri, 30 Oct 2020 08:40:27 +0000
(14:10 +0530)
Make use of the new struct_size() helper instead of the offsetof() idiom.
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link:
https://lore.kernel.org/r/20201008141828.GA20325@embeddedor
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/stm32-mdma.c
patch
|
blob
|
history
diff --git
a/drivers/dma/stm32-mdma.c
b/drivers/dma/stm32-mdma.c
index 08cfbfab837bb29b697a2eb46ec234e9e6aae811..29e5e30524bb7f933e750bc6e163c833c73427ba 100644
(file)
--- a/
drivers/dma/stm32-mdma.c
+++ b/
drivers/dma/stm32-mdma.c
@@
-339,7
+339,7
@@
static struct stm32_mdma_desc *stm32_mdma_alloc_desc(
struct stm32_mdma_desc *desc;
int i;
- desc = kzalloc(
offsetof(typeof(*desc), node[count]
), GFP_NOWAIT);
+ desc = kzalloc(
struct_size(desc, node, count
), GFP_NOWAIT);
if (!desc)
return NULL;