USB: cleanup for previous patches

This patch (as951) cleans up a few loose ends from earlier patches.
Redundant checks for non-NULL urb->dev are removed, as are checks of
urb->dev->bus (which can never be NULL).  Conversely, a check for
non-NULL urb->ep is added to the unlink paths.

A homegrown round-down-to-power-of-2 loop is simplified by using the
ilog2 routine.  The comparison in usb_urb_dir_in() is made more
transparent.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alan Stern 2007-08-02 15:04:52 -04:00 committed by Greg Kroah-Hartman
parent 18ea5d00d0
commit d617bc83ff
3 changed files with 8 additions and 12 deletions

View file

@ -1395,7 +1395,7 @@ extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor,
*/
static inline int usb_urb_dir_in(struct urb *urb)
{
return (urb->transfer_flags & URB_DIR_MASK) != URB_DIR_OUT;
return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_IN;
}
/**