[PATCH 5/6] usb: string: size_t is unsigned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Testing if size_t is negative is not needed as size_t is unsigned.

Signed-off-by: Jules Maselbas <jmaselbas@xxxxxxxxx>
---
 drivers/usb/core/usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 5dc7993ac..e34cb5bf2 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -906,7 +906,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
 	int err;
 	unsigned int u, idx;
 
-	if (size <= 0 || !buf || !index)
+	if (!size || !buf || !index)
 		return -1;
 	buf[0] = 0;
 	tbuf = dma_alloc(USB_BUFSIZ);
-- 
2.21.0.196.g041f5ea


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux