lkml.org 
[lkml]   [2015]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/1 linux-next] exofs: convert simple_str to kstr
From
>   case Opt_pid:
> + {
> + int rc;
> +
> if (0 == match_strlcpy(str, &args[0], sizeof(str)))
> return -EINVAL;
> - opts->pid = simple_strtoull(str, NULL, 0);
> + rc = kstrtoull(str, 0, &opts->pid);
> + if (rc)
> + return rc;

kstrto*() functions were designed for proc/sysfs/sysctl/debugfs/...
files accepting 1 value from shell:

echo 42 >/proc/foo

To keep this simplest usecase simple kstrto*() functions accept
one optional newline character before mandatory NUL.
But in mount option parsing newlines aren't supposed to be.

I'll resend parse_integer() shortly which is better suited for such code
http://marc.info/?l=linux-kernel&m=142876674416451&w=4


\
 
 \ /
  Last update: 2015-04-30 13:41    [W:0.522 / U:26.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site