On Thu, Feb 13, 2014 at 11:50 AM, Dan Carpenter
<[email protected]> wrote:
> Hello Yehuda Sadeh,
>
> The patch 59c2be1e4d42: "rbd: use watch/notify for changes in rbd
> header" from Mar 21, 2011, leads to the following static checker
> warning:
>
>         drivers/block/rbd.c:687 parse_rbd_opts_token()
>         warn: we tested 'token < 0' before and it was 'false'
>
> drivers/block/rbd.c
>    677  static int parse_rbd_opts_token(char *c, void *private)
>    678  {
>    679          struct rbd_options *rbd_opts = private;
>    680          substring_t argstr[MAX_OPT_ARGS];
>    681          int token, intval, ret;
>    682
>    683          token = match_token(c, rbd_opts_tokens, argstr);
>    684          if (token < 0)
>                     ^^^^^^^^^
>    685                  return -EINVAL;
>    686
>    687          if (token < Opt_last_int) {
>                     ^^^^^^^^^^^^^^^^^^^^
> Opt_last_int is zero so this is never true.  Should the < be == or
> something?

Probably not.  It's there in case an integer option gets added to rbd
in the future.  See parse_fsopt_token() and the enums above it in
fs/ceph/super.c.

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to