* [PATCH] char/adi: Remove redundant less-than-zero check in adi_write()
@ 2025-09-03 20:23 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2025-09-03 20:23 UTC (permalink / raw)
To: Arnd Bergmann, Greg Kroah-Hartman; +Cc: Thorsten Blum, linux-kernel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-09-03 20:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-03 20:23 [PATCH] char/adi: Remove redundant less-than-zero check in adi_write() Thorsten Blum
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.