* [PATCH] nvme: remove an unnecessary condition
@ 2020-07-14 10:57 Dan Carpenter
2020-07-14 11:17 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-07-14 10:57 UTC (permalink / raw)
To: Keith Busch
Cc: Jens Axboe, kernel-janitors, Christoph Hellwig, linux-nvme,
Sagi Grimberg
"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>
---
drivers/nvme/host/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 3d00ea4e7146..5fb5e8ba531b 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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;
--
2.27.0
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nvme: remove an unnecessary condition
2020-07-14 10:57 [PATCH] nvme: remove an unnecessary condition Dan Carpenter
@ 2020-07-14 11:17 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2020-07-14 11:17 UTC (permalink / raw)
To: Dan Carpenter
Cc: Sagi Grimberg, kernel-janitors, linux-nvme, Jens Axboe,
Keith Busch, Christoph Hellwig
Thanks,
applied to nvme-5.9.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-14 11:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14 10:57 [PATCH] nvme: remove an unnecessary condition Dan Carpenter
2020-07-14 11:17 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).