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>

diff --git a/include/linux/usb.h b/include/linux/usb.h
index 019ae96..a51f34e 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1395,7 +1395,7 @@
  */
 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;
 }
 
 /**