usb: isp1760-hcd: Fix fall-through annotations
Subsystems (2)
PATCH 1/1 usb: isp1760-hcd: Fix fall-through annotations
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/usb/isp1760/isp1760-hcd.c: In function ‘collect_qtds’:drivers/usb/isp1760/isp1760-hcd.c:788:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
mem_reads8(hcd->regs, qtd->payload_addr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qtd->data_buffer,
~~~~~~~~~~~~~~~~~
qtd->actual_length);
~~~~~~~~~~~~~~~~~~~
drivers/usb/isp1760/isp1760-hcd.c:792:5: note: here
case OUT_PID:
^~~~Warning level 3 was used: -Wimplicit-fallthrough=3
Notice that, in this particular case, the code comments are modified in accordance with what GCC is expecting to find.
This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
---
Notice that this code has been out there since 2011, and who introduced the question mark was the original developer.
It'd be good if someone can confirm that the fall-through has been intentional all this time.
Thanks
--
Gustavo
drivers/usb/isp1760/isp1760-hcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/isp1760/isp1760-hcd.c +2 -2
@@ -788,11 +788,11 @@ static void collect_qtds(struct usb_hcd *hcd, struct isp1760_qh *qh,mem_reads8 (hcd->regs, qtd->payload_addr, qtd->data_buffer, qtd->actual_length); -/* Fall through (?) */ +/* Fall through */ case OUT_PID : qtd->urb->actual_length += qtd->actual_length; -/* Fall through ... */ +/* Fall through */ case SETUP_PID :break ; }
Greg Kroah-Hartman
maintainerQuoted 25 lines · Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/usb/isp1760/isp1760-hcd.c: In function ‘collect_qtds’:drivers/usb/isp1760/isp1760-hcd.c:788:6: warning: this statement may fall through [-Wimplicit-fallthrough=]mem_reads8(hcd->regs, qtd->payload_addr, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qtd->data_buffer, ~~~~~~~~~~~~~~~~~ qtd->actual_length); ~~~~~~~~~~~~~~~~~~~ drivers/usb/isp1760/isp1760-hcd.c:792:5: note: here case OUT_PID: ^~~~Warning level 3 was used: -Wimplicit-fallthrough=3
Notice that, in this particular case, the code comments are modified in accordance with what GCC is expecting to find.
This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
Quoted 7 lines
Signed-off-by Gustavo A. R. Silva <[email protected]>---
Notice that this code has been out there since 2011, and who introduced the question mark was the original developer.It'd be good if someone can confirm that the fall-through has been intentional all this time.
Yes, it looks intentional. Messy, and as no one has complained since 2011, let's leave it alone, I'll queue this up.
thanks,
greg k-h
Quoted 31 lines · Greg Kroah-Hartman
Quoted 30 lines · Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/usb/isp1760/isp1760-hcd.c: In function ‘collect_qtds’:drivers/usb/isp1760/isp1760-hcd.c:788:6: warning: this statement may fall through [-Wimplicit-fallthrough=]mem_reads8(hcd->regs, qtd->payload_addr, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ qtd->data_buffer, ~~~~~~~~~~~~~~~~~ qtd->actual_length); ~~~~~~~~~~~~~~~~~~~ drivers/usb/isp1760/isp1760-hcd.c:792:5: note: here case OUT_PID: ^~~~Warning level 3 was used: -Wimplicit-fallthrough=3
Notice that, in this particular case, the code comments are modified in accordance with what GCC is expecting to find.
This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.
Signed-off-by Gustavo A. R. Silva <[email protected]>---
Notice that this code has been out there since 2011, and who introduced the question mark was the original developer.
Quoted 6 lines
Quoted 2 lines
It'd be good if someone can confirm that the fall-through has been intentional all this time.
Yes, it looks intentional. Messy, and as no one has complained since 2011, let's leave it alone, I'll queue this up.
Great.
Thanks, Greg.
---
Gustavo