Skip to contentSkip to conversation

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

PATCH New Thorsten Blum 1 participant 1 message Sep 3, 2025 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

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

The function parameter 'size_t count' is unsigned and cannot be less than zero. Remove the redundant condition.

---
 drivers/char/adi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/adi.c +1 -1
index f9bec10a6064..4312b0cc391c 100644
@@ -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);
Signature · 1 line
2.51.0