Skip to content

Commit

Permalink
nvme: remove an unnecessary condition
Browse files Browse the repository at this point in the history
"v" is an unsigned int so it can't be more than UINT_MAX.  Removing this
check makes it easier to preserve the error code as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Dan Carpenter authored and Christoph Hellwig committed Jul 29, 2020
1 parent c5be1f2 commit eca9e82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3586,8 +3586,8 @@ static ssize_t nvme_ctrl_reconnect_delay_store(struct device *dev,
int err;

err = kstrtou32(buf, 10, &v);
if (err || v > UINT_MAX)
return -EINVAL;
if (err)
return err;

ctrl->opts->reconnect_delay = v;
return count;
Expand Down

0 comments on commit eca9e82

Please sign in to comment.