block: Use kcalloc instead of kzalloc to initialize array
PATCH 1/1 block: Use kcalloc instead of kzalloc to initialize array
This patch fixes checkpatch.pl warning:
WARNING: Prefer kcalloc over kzalloc with multiply
+ bio_slabs = kzalloc(bio_slab_max * sizeof(struct bio_slab), GFP_KERNEL);
--- block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/bio.c +1 -1
@@ -2051,7 +2051,7 @@ static int __init init_bio(void) { bio_slab_max =2 ; bio_slab_nr =0 ; - bio_slabs =kzalloc (bio_slab_max *sizeof (struct bio_slab ),GFP_KERNEL ); + bio_slabs =kcalloc (bio_slab_max,sizeof (struct bio_slab ),GFP_KERNEL );if (!bio_slabs)panic ("bio: can't allocate bios\n" );
Signature · 1 line
1.9.1
Quoted 9 lines · Helen Fornazier
This patch fixes checkpatch.pl warning:
WARNING: Prefer kcalloc over kzalloc with multiply
+bio_slabs=kzalloc(bio_slab_max * sizeof(struct bio_slab), GFP_KERNEL);Signed-off-by Helen Fornazier <[email protected]>--- block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The outreachy application process can only accept patches made in drivers/staging/* so there's nothing I can do with these block patches, sorry.
greg k-h
Quoted 12 lines · Greg KH
Quoted 4 lines · Helen Fornazier
This patch fixes checkpatch.pl warning:
WARNING: Prefer kcalloc over kzalloc with multiply
+bio_slabs= kzalloc(bio_slab_max *sizeof(struct bio_slab),
GFP_KERNEL);Quoted 5 lines
Signed-off-by Helen Fornazier <[email protected]>--- block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 6 lines
The outreachy application process can only accept patches made in
drivers/staging/*so there's nothing I can do with these block patches, sorry.greg k-h
No problem, I suspected about it after I sent the patches.
Signature · 1 line
Helen Fornazier