Skip to content

Commit 7ffd5c8

Browse files
JuliaLawallvinodkoul
authored andcommitted
dmaengine: rcar-dmac: 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 aafa88f commit 7ffd5c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/sh/rcar-dmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ rcar_dmac_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr,
12271227
* Allocate the sg list dynamically as it would consume too much stack
12281228
* space.
12291229
*/
1230-
sgl = kcalloc(sg_len, sizeof(*sgl), GFP_NOWAIT);
1230+
sgl = kmalloc_array(sg_len, sizeof(*sgl), GFP_NOWAIT);
12311231
if (!sgl)
12321232
return NULL;
12331233

0 commit comments

Comments
 (0)