diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-08-30 08:49:34 +0200 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2011-10-24 18:13:12 +0200 |
commit | 4d5077f1b2aa502a0ca98b450d1b16fbccfe9c63 (patch) | |
tree | dab8859206b0e198a2d0862a1228d8342073e659 /net | |
parent | 9p: move dereference after NULL check (diff) | |
download | linux-4d5077f1b2aa502a0ca98b450d1b16fbccfe9c63.tar.xz linux-4d5077f1b2aa502a0ca98b450d1b16fbccfe9c63.zip |
fs/9p: Cleanup option parsing in 9p
Instead of saying all integer argument option should be listed in the beginning
move integer parsing to each option type.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/9p/client.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 9eadadb0a698..0edee4de608a 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -123,21 +123,19 @@ static int parse_opts(char *opts, struct p9_client *clnt) options = tmp_options; while ((p = strsep(&options, ",")) != NULL) { - int token; + int token, r; if (!*p) continue; token = match_token(p, tokens, args); - if (token < Opt_trans) { - int r = match_int(&args[0], &option); + switch (token) { + case Opt_msize: + r = match_int(&args[0], &option); if (r < 0) { P9_DPRINTK(P9_DEBUG_ERROR, - "integer field, but no integer?\n"); + "integer field, but no integer?\n"); ret = r; continue; } - } - switch (token) { - case Opt_msize: clnt->msize = option; break; case Opt_trans: |