i2c: s3c2410: Mark expected switch fall-through
Subsystems (2)
PATCH 1/1 i2c: s3c2410: Mark expected switch fall-through
Mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/i2c/busses/i2c-s3c2410.c: In function 'i2c_s3c_irq_nextbyte':drivers/i2c/busses/i2c-s3c2410.c:431:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (i2c->state == STATE_READ)
^
drivers/i2c/busses/i2c-s3c2410.c:439:2: note: here
case STATE_WRITE:
^~~~
Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.
--- drivers/i2c/busses/i2c-s3c2410.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-s3c2410.c +1 -0
@@ -435,6 +435,7 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)* fall through to the write state, as we will need to * send a byte as well */ +/* Fall through */ case STATE_WRITE :/*
Signature · 1 line
2.22.0
Quoted 12 lines · Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/i2c/busses/i2c-s3c2410.c: In function 'i2c_s3c_irq_nextbyte':drivers/i2c/busses/i2c-s3c2410.c:431:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (i2c->state==STATE_READ)^
drivers/i2c/busses/i2c-s3c2410.c:439:2: note: here
caseSTATE_WRITE:
^~~~
Quoted 5 lines
Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.
Reported-by Stephen Rothwell <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>
-Kees
Quoted 19 lines
--- drivers/i2c/busses/i2c-s3c2410.c | 1 + 1 file changed, 1 insertion(+)drivers/i2c/busses/i2c-s3c2410.c +1
-0@@ -435,6 +435,7 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)* fall through to the write state, as we will need to * send a byte as well */ +/* Fall through */ case STATE_WRITE :/* Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
Wolfram Sang
AppliedQuoted 12 lines · Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/i2c/busses/i2c-s3c2410.c: In function 'i2c_s3c_irq_nextbyte':drivers/i2c/busses/i2c-s3c2410.c:431:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (i2c->state==STATE_READ)^
drivers/i2c/busses/i2c-s3c2410.c:439:2: note: here
caseSTATE_WRITE:
^~~~
Quoted 5 lines
Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.
Reported-by Stephen Rothwell <[email protected]>Signed-off-by Gustavo A. R. Silva <[email protected]>
Applied to for-current, thanks!