Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: clean up redundant tests on unsigned

temp, bytes and param->{length,sglen,vary} are unsigned so
these tests do nothing.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

roel kluin and committed by
Greg Kroah-Hartman
e64a5219 3b438e30

+2 -8
+2 -6
drivers/usb/host/ehci-dbg.c
··· 455 455 (scratch >> 16) & 0x7fff, 456 456 scratch, 457 457 td->urb); 458 - if (temp < 0) 459 - temp = 0; 460 - else if (size < temp) 458 + if (size < temp) 461 459 temp = size; 462 460 size -= temp; 463 461 next += temp; ··· 464 466 } 465 467 466 468 temp = snprintf (next, size, "\n"); 467 - if (temp < 0) 468 - temp = 0; 469 - else if (size < temp) 469 + if (size < temp) 470 470 temp = size; 471 471 size -= temp; 472 472 next += temp;
-2
drivers/usb/misc/usbtest.c
··· 192 192 { 193 193 struct urb *urb; 194 194 195 - if (bytes < 0) 196 - return NULL; 197 195 urb = usb_alloc_urb (0, GFP_KERNEL); 198 196 if (!urb) 199 197 return urb;