From: James Smart <james.smart@broadcom.com>
To: 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: Sat, 23 Jul 2016 08:52:18 -0700 [thread overview]
Message-ID: <09649a75-e9a1-11d7-37e2-48f4e93a3b2e@broadcom.com> (raw)
In-Reply-To: <5e325cbb-a140-8f26-7402-5dc1a2cd07ea@sandisk.com>
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.
-- james
next prev parent reply other threads:[~2016-07-23 15:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-23 0:23 James Smart
2016-07-23 1:32 ` Bart Van Assche
2016-07-23 15:52 ` James Smart [this message]
2016-08-11 21:02 ` Christoph Hellwig
2016-07-23 13:12 Alexey Dobriyan
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=09649a75-e9a1-11d7-37e2-48f4e93a3b2e@broadcom.com \
--to=james.smart@broadcom.com \
--cc=bart.vanassche@sandisk.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
all inboxes | Powered by JetHome®