linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: James Smart <james.smart@broadcom.com>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>,
	linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] add u64 number parser
Date: Thu, 11 Aug 2016 14:02:46 -0700	[thread overview]
Message-ID: <20160811210246.GC18013@infradead.org> (raw)
In-Reply-To: <09649a75-e9a1-11d7-37e2-48f4e93a3b2e@broadcom.com>

On Sat, Jul 23, 2016 at 08:52:18AM -0700, James Smart wrote:
> 
> On 7/22/2016 6:32 PM, Bart Van Assche wrote:
> > On 07/22/16 17:23, James Smart wrote:
> > > +    buf = kmalloc(len + 1, GFP_KERNEL);
> > > +    if (!buf)
> > > +        return -ENOMEM;
> > > +    memcpy(buf, s->from, len);
> > > +    buf[len] = '\0';
> > 
> > Hello James,
> > 
> > Have you considered to combine the above kmalloc() and memcpy() calls
> > into a single kasprintf(GFP_KERNEL, "%.*s", len, s->from) call?
> > 
> > Bart.
> > 
> 
> No, I followed the example of existing parse functions in the file.

The kasprintf would indeed be nicer, but I'm fine with keeping the
existing style for this patch.  Bonus points for sending a follow on
to convert all of them over.

Reviewed-by: Christoph Hellwig <hch@lst.de>

      reply	other threads:[~2016-08-11 21:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-23  0:23 [PATCH] add u64 number parser James Smart
2016-07-23  1:32 ` Bart Van Assche
2016-07-23 15:52   ` James Smart
2016-08-11 21:02     ` Christoph Hellwig [this message]

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=20160811210246.GC18013@infradead.org \
    --to=hch@infradead.org \
    --cc=bart.vanassche@sandisk.com \
    --cc=james.smart@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).