diff options
| author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2013-07-11 22:32:31 -0700 | 
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2013-07-29 13:58:12 +0300 | 
| commit | 925403f425a4a9c503f2fc295652647b1eb10d82 (patch) | |
| tree | eb3c1528de7ed53c3f6a5960e74c9fc1c36f6ace /drivers/usb/renesas_usbhs/mod_host.c | |
| parent | 519c6013d356fef95c9e45cfb533b3e68b47dbf4 (diff) | |
usb: renesas_usbhs: tidyup original usbhsx_for_each_xxx macro
Current usbhsx_for_each_xxx macro will read out-of-array's
memory after last loop operation.
It was not good C language operation, and the binary which was
compiled by (at least) gcc 4.8.1 is broken
This patch tidyup these issues
Reported-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Reviewed-by: Takashi Yoshii <takashi.yoshii.zj@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/renesas_usbhs/mod_host.c')
| -rw-r--r-- | drivers/usb/renesas_usbhs/mod_host.c | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c index b86815421c8d..e40f565004d0 100644 --- a/drivers/usb/renesas_usbhs/mod_host.c +++ b/drivers/usb/renesas_usbhs/mod_host.c @@ -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) | 
