All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: dm: impose configurable deadline for dm_request_fn's merge heuristic
@ 2015-03-02 16:31 Dan Carpenter
  2015-03-02 23:26 ` Mike Snitzer
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-03-02 16:31 UTC (permalink / raw)
  To: snitzer; +Cc: dm-devel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-02 23:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-02 16:31 dm: impose configurable deadline for dm_request_fn's merge heuristic Dan Carpenter
2015-03-02 23:26 ` Mike Snitzer

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.