Skip to contentSkip to conversation

nvme: remove an unnecessary condition

PATCH Applied Dan Carpenter 2 participants 2 messages Jul 14, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: remove an unnecessary condition

"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.

---
 drivers/nvme/host/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +2 -2
index 3d00ea4e7146..5fb5e8ba531b 100644
@@ -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;
Signature · 1 line
2.27.0