[PATCH] add u64 number parser

Bart Van Assche bart.vanassche at sandisk.com
Fri Jul 22 18:32:23 PDT 2016


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.




More information about the Linux-nvme mailing list