Skip to content

Commit aafa88f

Browse files
JuliaLawallvinodkoul
authored andcommitted
dmaengine: sh: drop double zeroing
sg_init_table zeroes its first argument, so the allocation of that argument doesn't have to. the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,n,flags; @@ x = - kcalloc + kmalloc_array (n,sizeof(*x),flags) ... sg_init_table(x,n) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 028926e commit aafa88f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/sh/shdma-base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ static struct dma_async_tx_descriptor *shdma_prep_dma_cyclic(
728728
* Allocate the sg list dynamically as it would consumer too much stack
729729
* space.
730730
*/
731-
sgl = kcalloc(sg_len, sizeof(*sgl), GFP_KERNEL);
731+
sgl = kmalloc_array(sg_len, sizeof(*sgl), GFP_KERNEL);
732732
if (!sgl)
733733
return NULL;
734734

0 commit comments

Comments
 (0)