All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: snitzer@redhat.com
Cc: dm-devel@redhat.com
Subject: Re: dm: impose configurable deadline for dm_request_fn's merge heuristic
Date: Mon, 2 Mar 2015 19:31:44 +0300	[thread overview]
Message-ID: <20150302163143.GA27120@mwanda> (raw)

Hello Mike Snitzer,

The patch 6ee47d96b97d: "dm: impose configurable deadline for
dm_request_fn's merge heuristic" from Feb 26, 2015, leads to the
following static checker warning:

	drivers/md/dm.c:1968 dm_attr_rq_based_queue_deadline_store()
	warn: impossible condition '(deadline > ((~0 >> 1))) => (s32min-s32max > s32max)'

drivers/md/dm.c
  1959  ssize_t dm_attr_rq_based_queue_deadline_store(struct mapped_device *md,
  1960                                                const char *buf, size_t count)
  1961  {
  1962          int err, deadline;
  1963  
  1964          if (!dm_request_based(md))
  1965                  return count;
  1966  
  1967          err = kstrtoint(buf, 10, &deadline);
  1968          if (err || deadline > INT_MAX)
                           ^^^^^^^^^^^^^^^^^^
Impossible condition.  But it might not hurt to test for negative
deadlines?

  1969                  return -EINVAL;
  1970  
  1971          if (!deadline)
  1972                  deadline = DEF_QUEUE_DEADLINE;
  1973          else if (deadline > MAX_QUEUE_DEADLINE)
  1974                  deadline = MAX_QUEUE_DEADLINE;
  1975  
  1976          atomic_set(&md->rq_based_queue_deadline, deadline);
  1977  
  1978          return count;
  1979  }

regards,
dan carpenter

             reply	other threads:[~2015-03-02 16:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 16:31 Dan Carpenter [this message]
2015-03-02 23:26 ` dm: impose configurable deadline for dm_request_fn's merge heuristic Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150302163143.GA27120@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=dm-devel@redhat.com \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.