public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usbip: remove check for negative values for an unsigned value
@ 2011-05-26  7:24 Németh Márton
  0 siblings, 0 replies; only message in thread
From: Németh Márton @ 2011-05-26  7:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Matt Mooney, Max Vozeler, Arnd Bergmann
  Cc: Julia Lawall, usbip-devel, linux-usb, devel, LKML

From: Márton Németh <nm127@freemail.hu>

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 <nm127@freemail.hu>
---
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;
 	}

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-26  7:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-26  7:24 [PATCH] usbip: remove check for negative values for an unsigned value Németh Márton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox