[lkml]   [2011]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] usbip: remove check for negative values for an unsigned value
From: Márton Németh <>

The parameter rhport is unsigned so there is no need checking for
negative values.

This will remove the following warning message when compiling with "make W=1 ...":
drivers/staging/usbip/vhci_sysfs.c: In function ‘valid_args’:
drivers/staging/usbip/vhci_sysfs.c:138: warning: comparison of unsigned expression < 0 is always false

Signed-off-by: Márton Németh <>
diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c
index d9736f9..7b6e4a9 100644
--- a/drivers/staging/usbip/vhci_sysfs.c
+++ b/drivers/staging/usbip/vhci_sysfs.c
@@ -135,7 +135,7 @@ static DEVICE_ATTR(detach, S_IWUSR, NULL, store_detach);
static int valid_args(__u32 rhport, enum usb_device_speed speed)
/* check rhport */
- if ((rhport < 0) || (rhport >= VHCI_NPORTS)) {
+ if (rhport >= VHCI_NPORTS) {
pr_err("port %u\n", rhport);
return -EINVAL;
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2011-05-26 09:27    [W:0.031 / U:11.720 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site