Skip to content

Commit

Permalink
fs/ncpfs/getopt.c: replace simple_strtoul by kstrtoul
Browse files Browse the repository at this point in the history
Remove obsolete simple_strtoul in ncp_getopt

Signed-off-by: Fabian Frederick <[email protected]>
Cc: Petr Vandrovec <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Fabian Frederick authored and torvalds committed Jun 4, 2014
1 parent 647f010 commit 8091b89
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions fs/ncpfs/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,14 @@ int ncp_getopt(const char *caller, char **options, const struct ncp_option *opts
return -EINVAL;
}
if (opts->has_arg & OPT_INT) {
char* v;
int rc = kstrtoul(val, 0, value);

*value = simple_strtoul(val, &v, 0);
if (!*v) {
return opts->val;
if (rc) {
pr_info("%s: invalid numeric value in %s=%s\n",
caller, token, val);
return rc;
}
pr_info("%s: invalid numeric value in %s=%s\n",
caller, token, val);
return -EDOM;
return opts->val;
}
if (opts->has_arg & OPT_STRING) {
return opts->val;
Expand Down

0 comments on commit 8091b89

Please sign in to comment.