usb: renesas_usbhs: tidyup original usbhsx_for_each_xxx macro
[pandora-kernel.git] / drivers / usb / renesas_usbhs / mod_host.c
index b868154..e40f565 100644 (file)
@@ -111,9 +111,9 @@ static const char usbhsh_hcd_name[] = "renesas_usbhs host";
        container_of(usbhs_mod_get(priv, USBHS_HOST), struct usbhsh_hpriv, mod)
 
 #define __usbhsh_for_each_udev(start, pos, h, i)       \
-       for (i = start, pos = (h)->udev + i;            \
-            i < USBHSH_DEVICE_MAX;                     \
-            i++, pos = (h)->udev + i)
+       for ((i) = start;                                               \
+            ((i) < USBHSH_DEVICE_MAX) && ((pos) = (h)->udev + (i));    \
+            (i)++)
 
 #define usbhsh_for_each_udev(pos, hpriv, i)    \
        __usbhsh_for_each_udev(1, pos, hpriv, i)