Commit 2d9c7f3c authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Felipe Balbi

usb: renesas_usbhs: tidyup usbhs_for_each_dfifo macro

Current usbhs_for_each_dfifo 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 is based on
925403f4
(usb: renesas_usbhs: tidyup original usbhsx_for_each_xxx macro)
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 87841c88
...@@ -45,9 +45,10 @@ struct usbhs_fifo_info { ...@@ -45,9 +45,10 @@ struct usbhs_fifo_info {
}; };
#define usbhsf_get_dnfifo(p, n) (&((p)->fifo_info.dfifo[n])) #define usbhsf_get_dnfifo(p, n) (&((p)->fifo_info.dfifo[n]))
#define usbhs_for_each_dfifo(priv, dfifo, i) \ #define usbhs_for_each_dfifo(priv, dfifo, i) \
for ((i) = 0, dfifo = usbhsf_get_dnfifo(priv, (i)); \ for ((i) = 0; \
((i) < USBHS_MAX_NUM_DFIFO); \ ((i) < USBHS_MAX_NUM_DFIFO) && \
(i)++, dfifo = usbhsf_get_dnfifo(priv, (i))) ((dfifo) = usbhsf_get_dnfifo(priv, (i))); \
(i)++)
struct usbhs_pkt_handle; struct usbhs_pkt_handle;
struct usbhs_pkt { struct usbhs_pkt {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment