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);
> > > +
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
> + ret = kstrtoull(buf, base, &val);
> + if (!ret)
> + *result = val;
Simply pass "result" directly to kstrtoull(). It will not write the result
in case of error.
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 kasp
add u64 number parser
Will be used by the nvme-fabrics FC transport in parsing options
Signed-off-by: James Smart
---
include/linux/parser.h | 1 +
lib/parser.c | 47 +++
2 files changed, 48 insertions(+)
diff --git a/include/linux/parser
5 matches
Mail list logo