mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Joe Perches <joe@perches.com>
Cc: Silvio F <silvio.fricke@gmail.com>,
	linux-kernel@vger.kernel.org, daeseok.youn@gmail.com,
	silvio@port1024.net
Subject: Re: [PATCH] staging: unisys: kmalloc/memset to kzalloc conversation
Date: Tue, 18 Mar 2014 13:41:24 -0700	[thread overview]
Message-ID: <20140318204124.GB26473@kroah.com> (raw)
In-Reply-To: <1395173845.2812.82.camel@joe-AO722>

On Tue, Mar 18, 2014 at 01:17:25PM -0700, Joe Perches wrote:
> On Tue, 2014-03-18 at 21:07 +0100, Silvio F wrote:
> > This patch solves the Coccinelle warning: "kzalloc should be used
> > instead of kmalloc/memset"
> []
> > diff --git a/drivers/staging/unisys/include/uisutils.h b/drivers/staging/unisys/include/uisutils.h
> []
> > @@ -190,10 +190,7 @@ struct chaninfo {
> >  }
> >  
> >  #define ALLOC_CMDRSP(cmdrsp) { \
> > -	cmdrsp = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC); \
> > -	if (cmdrsp != NULL) { \
> > -		memset(cmdrsp, 0, SIZEOF_CMDRSP); \
> > -	} \
> > +	cmdrsp = kzalloc(SIZEOF_CMDRSP, GFP_ATOMIC); \
> >  }
> 
> It'd be nicer to get rid of this macro altogether
> and substitute kzalloc in the 3 places it's used.

Yes, that's the better thing to do overall.

thanks,

greg k-h

  reply	other threads:[~2014-03-18 20:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12 10:37 [PATCH] staging: unisys: use kzalloc instead of kmalloc/memset 0 Daeseok Youn
2014-03-17 21:41 ` Greg KH
2014-03-18  0:26   ` DaeSeok Youn
2014-03-18  0:37     ` Greg KH
2014-03-18  8:11       ` DaeSeok Youn
2014-03-19  0:03         ` DaeSeok Youn
2014-03-19  0:58           ` Greg KH
2014-03-19  1:04             ` DaeSeok Youn
2014-03-19  2:31               ` Greg KH
2014-03-19  4:32                 ` DaeSeok Youn
2014-03-18 13:00     ` Ken Cox
2014-03-19  0:09       ` DaeSeok Youn
2014-03-19  0:58         ` Greg KH
2014-03-18 20:07 ` [patch][wip] staging: unisys: kmalloc/memset move to kzalloc Silvio F
2014-03-18 20:07   ` [PATCH] staging: unisys: kmalloc/memset to kzalloc conversation Silvio F
2014-03-18 20:17     ` Joe Perches
2014-03-18 20:41       ` Greg KH [this message]
2014-03-18 20:41     ` Greg KH
2014-03-18 20:46       ` Silvio F.
2014-03-18 21:13 ` [patch][wip] staging: unisys: kmalloc/memset move to kzalloc Silvio F
2014-03-18 21:13   ` [PATCH] staging: unisys: kmalloc/memset to kzalloc conversation Silvio F

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140318204124.GB26473@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=daeseok.youn@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=silvio.fricke@gmail.com \
    --cc=silvio@port1024.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome