From: Bart Van Assche <bart.vanassche@sandisk.com>
To: James Smart <james.smart@broadcom.com>,
<linux-kernel@vger.kernel.org>, <linux-nvme@lists.infradead.org>,
<linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] add u64 number parser
Date: Fri, 22 Jul 2016 18:32:23 -0700 [thread overview]
Message-ID: <5e325cbb-a140-8f26-7402-5dc1a2cd07ea@sandisk.com> (raw)
In-Reply-To: <5792b919.0C1gyf+dF4XKu6Zj%james.smart@broadcom.com>
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.
next prev parent reply other threads:[~2016-07-23 1:47 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 [this message]
2016-07-23 15:52 ` James Smart
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=5e325cbb-a140-8f26-7402-5dc1a2cd07ea@sandisk.com \
--to=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
all inboxes | Powered by JetHome®