]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
char/adi: Remove redundant less-than-zero check in adi_write()
authorThorsten Blum <thorsten.blum@linux.dev>
Wed, 3 Sep 2025 20:23:51 +0000 (22:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Sep 2025 14:00:36 +0000 (16:00 +0200)
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>
Link: https://lore.kernel.org/r/20250903202350.182446-2-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/adi.c

index f9bec10a60642b86d83956b80709c41e1362bc7f..4312b0cc391cd0ee8ef67ca60f76fe8b60f94ae0 100644 (file)
@@ -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);