misc: Use kzalloc() instead of kmalloc() with flag GFP_ZERO.
PATCH 1/1 misc: Use kzalloc() instead of kmalloc() with flag GFP_ZERO.
From: Huang Zijiang <[email protected]>
Use kzalloc instead of manually setting kmalloc with flag GFP_ZERO since kzalloc sets allocated memory to zero.
--- drivers/misc/mic/host/mic_boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/mic/host/mic_boot.c +1 -1
@@ -137,7 +137,7 @@ static void *__mic_dma_alloc(struct device *dev, size_t size,struct scif_hw_dev *scdev =dev_get_drvdata (dev);struct mic_device *mdev =scdev_to_mdev (scdev);dma_addr_t tmp; -void *va =kmalloc (size, gfp | __GFP_ZERO); +void *va =kzalloc (size, gfp);if (va) { tmp =mic_map_single (mdev, va, size);
Signature · 1 line
1.9.1
Greg KH
maintainerQuoted 17 lines · Yi Wang
From: Huang Zijiang <[email protected]>
Use kzalloc instead of manually setting kmalloc with flag
GFP_ZEROsince kzalloc sets allocated memory to zero.Signed-off-by Huang Zijiang <[email protected]>Signed-off-by Yi Wang <[email protected]>--- drivers/misc/mic/host/mic_boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/mic/host/mic_boot.c +0
-0
drivers/misc/mic/host/mic_boot.c static void *__mic_dma_alloc(struct device *dev, size_t size, · line 140
Quoted 5 lines
drivers/misc/mic/host/mic_boot.c +1
-1@@ -137,7 +137,7 @@ static void *__mic_dma_alloc(struct device *dev, size_t size,struct scif_hw_dev *scdev =dev_get_drvdata (dev);struct mic_device *mdev =scdev_to_mdev (scdev);dma_addr_t tmp; -void *va =kmalloc (size, gfp | __GFP_ZERO); +void *va =kzalloc (size, gfp);
Odd indation :(
Always use checkpatch.pl on your patches to ensure you do not add new problems.
How did this get past 2 different people???
greg k-h
Quoted 27 lines · Greg KH
Quoted 17 lines · Yi Wang
From: Huang Zijiang <[email protected]>
Use kzalloc instead of manually setting kmalloc with flag
GFP_ZEROsince kzalloc sets allocated memory to zero.Signed-off-by Huang Zijiang <[email protected]>Signed-off-by Yi Wang <[email protected]>--- drivers/misc/mic/host/mic_boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/mic/host/mic_boot.c +0
-0drivers/misc/mic/host/mic_boot.c static void *__mic_dma_alloc(struct device *dev, size_t size, · line 140
Quoted 5 lines
drivers/misc/mic/host/mic_boot.c +1
-1@@ -137,7 +137,7 @@ static void *__mic_dma_alloc(struct device *dev, size_t size,struct scif_hw_dev *scdev =dev_get_drvdata (dev);struct mic_device *mdev =scdev_to_mdev (scdev);dma_addr_t tmp; -void *va =kmalloc (size, gfp | __GFP_ZERO); +void *va =kzalloc (size, gfp);Odd indation :(
Quoted 4 lines
Always use checkpatch.pl on your patches to ensure you do not add new problems.
How did this get past 2 different people???
Sorry, didn't see the mail, it ended up in Junk. Thanks for catching it.