lkml.org 
[lkml]   [2019]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] misc: Use kzalloc() instead of kmalloc() with flag GFP_ZERO.
On Mon, 23 Dec 2019 04:04:28 -0800, Greg KH wrote:
>
> On Mon, Dec 23, 2019 at 09:51:58AM +0800, Yi Wang wrote:
> > 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);
>
> 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???

Sorry, didn't see the mail, it ended up in Junk. Thanks for catching it.

\
 
 \ /
  Last update: 2019-12-23 22:42    [W:0.036 / U:8.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site