Skip to content

Commit

Permalink
USB: clean up redundant tests on unsigned
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
roel kluin authored and Greg Kroah-Hartman committed Jan 7, 2009
1 parent 3b438e3 commit e64a521
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 2 additions & 6 deletions drivers/usb/host/ehci-dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,7 @@ static void qh_lines (
(scratch >> 16) & 0x7fff,
scratch,
td->urb);
if (temp < 0)
temp = 0;
else if (size < temp)
if (size < temp)
temp = size;
size -= temp;
next += temp;
Expand All @@ -466,9 +464,7 @@ static void qh_lines (
}

temp = snprintf (next, size, "\n");
if (temp < 0)
temp = 0;
else if (size < temp)
if (size < temp)
temp = size;
size -= temp;
next += temp;
Expand Down
2 changes: 0 additions & 2 deletions drivers/usb/misc/usbtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ static struct urb *simple_alloc_urb (
{
struct urb *urb;

if (bytes < 0)
return NULL;
urb = usb_alloc_urb (0, GFP_KERNEL);
if (!urb)
return urb;
Expand Down

0 comments on commit e64a521

Please sign in to comment.