Skip to contentSkip to conversation

mfd: mxs-lradc: Mark expected switch fall-through

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Feb 11, 2019 – Feb 14, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: mxs-lradc: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/mfd/mxs-lradc.c: In function ‘mxs_lradc_probe’:
drivers/mfd/mxs-lradc.c:179:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

    if (lradc->soc == IMX28_LRADC) {
       ^

drivers/mfd/mxs-lradc.c:185:3: note: here
default:
^~~~~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

---
 drivers/mfd/mxs-lradc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/mxs-lradc.c +1 -1
index 98e732a7ae96..a09a8d06302b 100644
@@ -181,7 +181,7 @@ static int mxs_lradc_probe(struct platform_device *pdev)
 					MXS_LRADC_TOUCHSCREEN_5WIRE;
 				break;
 			}
-			/* fall through to an error message for i.MX23 */
+			/* fall through - to an error message for i.MX23 */
 		default:
 			dev_err(&pdev->dev,
 				"Unsupported number of touchscreen wires (%d)\n"
Signature · 1 line
2.20.1
Applied
#1 lore raw
Quoted 18 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/mfd/mxs-lradc.c: In function ‘mxs_lradc_probe’:
drivers/mfd/mxs-lradc.c:179:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

    if (lradc->soc == IMX28_LRADC) {
       ^
drivers/mfd/mxs-lradc.c:185:3: note: here
   default:
   ^~~~~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

Quoted 7 lines

This patch is part of the ongoing efforts to enable -Wimplicit-fallthrough.

---
 drivers/mfd/mxs-lradc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog