Linux wireless drivers development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Chaehyun Lim <chaehyun.lim@gmail.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	devel@driverdev.osuosl.org, Chris Park <chris.park@atmel.com>,
	Austin Shin <austin.shin@atmel.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	Johnny Kim <johnny.kim@atmel.com>,
	"tony.cho" <tony.cho@atmel.com>,
	leo.kim@atmel.com
Subject: Re: [PATCH 25/27] staging: wilc1000: fix coding style of kmalloc usage
Date: Thu, 21 Jan 2016 13:04:56 +0300	[thread overview]
Message-ID: <20160121100456.GD6421@mwanda> (raw)
In-Reply-To: <CAKV=isvj-RbzMCOS+UyXkXyuyX2_SLhDyVTNaJy4kQbfN+bxSg@mail.gmail.com>

On Thu, Jan 21, 2016 at 07:01:45PM +0900, Chaehyun Lim wrote:
> On Thu, Jan 21, 2016 at 5:55 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > On Thu, Jan 21, 2016 at 01:48:16PM +0530, Sudip Mukherjee wrote:
> >> On Thu, Jan 21, 2016 at 10:20:28AM +0900, Chaehyun Lim wrote:
> >> > This patch fixes coding style of kmalloc usage found by checkpatch.
> >> > CHECK: Prefer kmalloc(sizeof(*new_msg)...) over kmalloc(sizeof(struct message)...)
> >> >
> >> > Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
> >> > ---
> >> >  drivers/staging/wilc1000/wilc_msgqueue.c | 2 +-
> >> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >> >
> >> > diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
> >> > index 7107715..c7a60f4 100644
> >> > --- a/drivers/staging/wilc1000/wilc_msgqueue.c
> >> > +++ b/drivers/staging/wilc1000/wilc_msgqueue.c
> >> > @@ -70,7 +70,7 @@ int wilc_mq_send(struct message_queue *mq,
> >> >     }
> >> >
> >> >     /* construct a new message */
> >> > -   new_msg = kmalloc(sizeof(struct message), GFP_ATOMIC);
> >> > +   new_msg = kmalloc(sizeof(*new_msg), GFP_ATOMIC);
> >>
> >> This checkpatch error was introduced by 1/27 patch of this series. Maybe
> >> it will be better to fix it in that one.
> >
> > The warning was introduced there but the issue went back further it's
> > just that checkpatch didn't detect it because of other issues.  This
> > seems fine.
> 
> I appreciate for all comment. I will resend it after applying Sudip's review.
> 

That's fine too, but the original way is more correct because it only
fixes one thing at a time and is easier to review.

regards,
dan carpenter


  reply	other threads:[~2016-01-21 10:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21  1:20 [PATCH 01/27] staging: wilc1000: rename struct __Message_struct Chaehyun Lim
2016-01-21  1:20 ` [PATCH 02/27] staging: wilc1000: rename pvBuffer in struct message Chaehyun Lim
2016-01-21  1:20 ` [PATCH 03/27] staging: wilc1000: rename u32Length " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 04/27] staging: wilc1000: rename pstrNext " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 05/27] staging: wilc1000: rename struct WILC_MsgQueueHandle Chaehyun Lim
2016-01-21  1:20 ` [PATCH 06/27] staging: wilc1000: rename hSem in struct message_queue Chaehyun Lim
2016-01-21  1:20 ` [PATCH 07/27] staging: wilc1000: rename strCriticalSection " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 08/27] staging: wilc1000: rename bExiting " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 09/27] staging: wilc1000: rename u32ReceiversCount " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 10/27] staging: wilc1000: rename pstrMessageList " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 11/27] staging: wilc1000: rename pHandle in wilc_mq_create Chaehyun Lim
2016-01-21  1:20 ` [PATCH 12/27] staging: wilc1000: rename pHandle in wilc_mq_destroy Chaehyun Lim
2016-01-21  1:20 ` [PATCH 13/27] staging: wilc1000: rename pstrMessge " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 14/27] staging: wilc1000: rename pHandle in wilc_mq_send Chaehyun Lim
2016-01-21  1:20 ` [PATCH 15/27] staging: wilc1000: rename pvSendBuffer " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 16/27] staging: wilc1000: rename u32SendBufferSize " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 17/27] staging: wilc1000: rename pstrMessage " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 18/27] staging: wilc1000: rename tail_msg " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 19/27] staging: wilc1000: fix return error code Chaehyun Lim
2016-01-21  1:20 ` [PATCH 20/27] staging: wilc1000: rename pHandle in wilc_mq_recv Chaehyun Lim
2016-01-21  1:20 ` [PATCH 21/27] staging: wilc1000: rename pvRecvBuffer " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 22/27] staging: wilc1000: rename u32RecvBufferSize " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 23/27] staging: wilc1000: rename pu32ReceivedLength " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 24/27] staging: wilc1000: rename pstrMessage " Chaehyun Lim
2016-01-21  1:20 ` [PATCH 25/27] staging: wilc1000: fix coding style of kmalloc usage Chaehyun Lim
2016-01-21  8:18   ` Sudip Mukherjee
2016-01-21  8:55     ` Dan Carpenter
2016-01-21 10:01       ` Chaehyun Lim
2016-01-21 10:04         ` Dan Carpenter [this message]
2016-01-21 11:11           ` Chaehyun Lim
2016-01-21  1:20 ` [PATCH 26/27] staging: wilc1000: fix logical continuations Chaehyun Lim
2016-01-21  1:20 ` [PATCH 27/27] staging: wilc1000: remove over-commenting Chaehyun Lim

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=20160121100456.GD6421@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=austin.shin@atmel.com \
    --cc=chaehyun.lim@gmail.com \
    --cc=chris.park@atmel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johnny.kim@atmel.com \
    --cc=leo.kim@atmel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    --cc=tony.cho@atmel.com \
    /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