usb: renesas_usbhs: tidyup original usbhsx_for_each_xxx macro
[pandora-kernel.git] / drivers / usb / renesas_usbhs / mod_host.c
index 7955de5..b3a610c 100644 (file)
@@ -131,9 +131,9 @@ static const char usbhsh_hcd_name[] = "renesas_usbhs host";
        __usbhsh_for_each_hpipe(0, pos, hpriv, i)
 
 #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)