lib/scatterlist.c: avoid a double memset
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 16 Oct 2020 03:11:25 +0000 (20:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Oct 2020 18:11:20 +0000 (11:11 -0700)
'sgl' is zeroed a few lines below in 'sg_init_table()'. There is no need to
clear it twice.

Remove the redundant initialization.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lkml.kernel.org/r/20200920071544.368841-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/scatterlist.c

index 5d63a88..d94628f 100644 (file)
@@ -504,7 +504,7 @@ struct scatterlist *sgl_alloc_order(unsigned long long length,
                nalloc++;
        }
        sgl = kmalloc_array(nalloc, sizeof(struct scatterlist),
-                           (gfp & ~GFP_DMA) | __GFP_ZERO);
+                           gfp & ~GFP_DMA);
        if (!sgl)
                return NULL;