[PATCH] char/adi: Remove redundant less-than-zero check in adi_write()

Thorsten Blum posted 1 patch 4 weeks, 1 day ago
drivers/char/adi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] char/adi: Remove redundant less-than-zero check in adi_write()
Posted by Thorsten Blum 4 weeks, 1 day ago
The function parameter 'size_t count' is unsigned and cannot be less
than zero. Remove the redundant condition.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/char/adi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/adi.c b/drivers/char/adi.c
index f9bec10a6064..4312b0cc391c 100644
--- a/drivers/char/adi.c
+++ b/drivers/char/adi.c
@@ -131,7 +131,7 @@ static ssize_t adi_write(struct file *file, const char __user *buf,
 	ssize_t ret;
 	int i;
 
-	if (count <= 0)
+	if (count == 0)
 		return -EINVAL;
 
 	ver_buf_sz = min_t(size_t, count, MAX_BUF_SZ);
-- 
2.51.0