linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] misc: Use kzalloc() instead of kmalloc() with flag GFP_ZERO.
@ 2020-02-12  9:54 Yi Wang
  2020-02-14 17:16 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Yi Wang @ 2020-02-12  9:54 UTC (permalink / raw)
  To: sudeep.dutt
  Cc: ashutosh.dixit, arnd, gregkh, vincent.whitchurch, alexios.zavras,
	tglx, allison, linux-kernel, xue.zhihong, wang.yi59,
	wang.liang82, Huang Zijiang

From: Huang Zijiang <huang.zijiang@zte.com.cn>

Use kzalloc instead of manually setting kmalloc
with flag GFP_ZERO since kzalloc sets allocated memory
to zero.

Change in v2:
     add indation

Signed-off-by: Huang Zijiang <huang.zijiang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 drivers/misc/mic/host/mic_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/mic/host/mic_boot.c b/drivers/misc/mic/host/mic_boot.c
index 4f2d921..fb5b398 100644
--- a/drivers/misc/mic/host/mic_boot.c
+++ b/drivers/misc/mic/host/mic_boot.c
@@ -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);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] misc: Use kzalloc() instead of kmalloc() with flag GFP_ZERO.
@ 2019-12-23  1:51 Yi Wang
  2019-12-23 12:04 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Yi Wang @ 2019-12-23  1:51 UTC (permalink / raw)
  To: sudeep.dutt
  Cc: ashutosh.dixit, arnd, gregkh, vincent.whitchurch, alexios.zavras,
	tglx, allison, linux-kernel, xue.zhihong, wang.yi59, up2wing,
	wang.liang82, Huang Zijiang

From: Huang Zijiang <huang.zijiang@zte.com.cn>

Use kzalloc instead of manually setting kmalloc
with flag GFP_ZERO since kzalloc sets allocated memory
to zero.

Signed-off-by: Huang Zijiang <huang.zijiang@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 drivers/misc/mic/host/mic_boot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/mic/host/mic_boot.c b/drivers/misc/mic/host/mic_boot.c
index 7335759..c1f87a4 100644
--- a/drivers/misc/mic/host/mic_boot.c
+++ b/drivers/misc/mic/host/mic_boot.c
@@ -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);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-14 20:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12  9:54 [PATCH] misc: Use kzalloc() instead of kmalloc() with flag GFP_ZERO Yi Wang
2020-02-14 17:16 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2019-12-23  1:51 Yi Wang
2019-12-23 12:04 ` Greg KH
2019-12-23 21:42   ` Dixit, Ashutosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).