Skip to contentSkip to conversation

bus: ti-sysc: Add break in switch statement in sysc_init_soc()

PATCH In review Nathan Chancellor 3 participants 3 messages Aug 15, 2021 – Aug 19, 2021 OMAP2+ support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus: ti-sysc: Add break in switch statement in sysc_init_soc()

After commit a6d90e9f2232 ("bus: ti-sysc: AM3: RNG is GP only"), clang with -Wimplicit-fallthrough enabled warns:

drivers/bus/ti-sysc.c:2958:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

                default:
                ^
drivers/bus/ti-sysc.c:2958:3: note: insert 'break;' to avoid
fall-through
                default:
                ^
                break;

1 warning generated.

Clang's version of this warning is a little bit more pedantic than GCC's. Add the missing break to satisfy it to match what has been done all over the kernel tree.

---
 drivers/bus/ti-sysc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/bus/ti-sysc.c +1 -0
index 0ef98e3ba341..afe8222db7cd 100644
@@ -2955,6 +2955,7 @@ static int sysc_init_soc(struct sysc *ddata)
 			break;
 		case SOC_AM3:
 			sysc_add_disabled(0x48310000);  /* rng */
+			break;
 		default:
 			break;
 		}

base-commit: ba31f97d43be41ca99ab72a6131d7c226306865f

Signature · 1 line
2.33.0.rc2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Nathan Chancellor

After commit a6d90e9f2232 ("bus: ti-sysc: AM3: RNG is GP only"), clang with -Wimplicit-fallthrough enabled warns:

drivers/bus/ti-sysc.c:2958:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

                default:
                ^
drivers/bus/ti-sysc.c:2958:3: note: insert 'break;' to avoid
fall-through
                default:
                ^
                break;
Quoted 7 lines

1 warning generated.

Clang's version of this warning is a little bit more pedantic than GCC's. Add the missing break to satisfy it to match what has been done all over the kernel tree.

Thanks for the patch!

Quoted 25 lines
---
 drivers/bus/ti-sysc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/bus/ti-sysc.c +1 -0
index 0ef98e3ba341..afe8222db7cd 100644
@@ -2955,6 +2955,7 @@ static int sysc_init_soc(struct sysc *ddata)
                        break;
                case SOC_AM3:
                        sysc_add_disabled(0x48310000);  /* rng */
+                       break;
                default:
                        break;
                }

base-commit: ba31f97d43be41ca99ab72a6131d7c226306865f --
2.33.0.rc2

--
You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20210815191852.52271-1-nathan%40kernel.org.

Signature · 2 lines
Thanks,
~Nick Desaulniers
maintainer
#2 lore raw
In reply to Nathan Chancellor
Quoted 6 lines · Nathan Chancellor

After commit a6d90e9f2232 ("bus: ti-sysc: AM3: RNG is GP only"), clang with -Wimplicit-fallthrough enabled warns:

drivers/bus/ti-sysc.c:2958:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
default:

Thanks applying into fixes.

Regards,

Tony