LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] bus: ti-sysc: Add break in switch statement in sysc_init_soc()
@ 2021-08-15 19:18 Nathan Chancellor
  2021-08-16 18:43 ` Nick Desaulniers
  2021-08-19  6:40 ` Tony Lindgren
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2021-08-15 19:18 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Nick Desaulniers, Gustavo A. R. Silva, Kees Cook, linux-omap,
	linux-kernel, clang-built-linux, 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;
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.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/bus/ti-sysc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 0ef98e3ba341..afe8222db7cd 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bus: ti-sysc: Add break in switch statement in sysc_init_soc()
  2021-08-15 19:18 [PATCH] bus: ti-sysc: Add break in switch statement in sysc_init_soc() Nathan Chancellor
@ 2021-08-16 18:43 ` Nick Desaulniers
  2021-08-19  6:40 ` Tony Lindgren
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2021-08-16 18:43 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Tony Lindgren, Gustavo A. R. Silva, Kees Cook, linux-omap,
	linux-kernel, clang-built-linux

On Sun, Aug 15, 2021 at 12:19 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> 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.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  drivers/bus/ti-sysc.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> index 0ef98e3ba341..afe8222db7cd 100644
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> @@ -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 clang-built-linux+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20210815191852.52271-1-nathan%40kernel.org.



-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bus: ti-sysc: Add break in switch statement in sysc_init_soc()
  2021-08-15 19:18 [PATCH] bus: ti-sysc: Add break in switch statement in sysc_init_soc() Nathan Chancellor
  2021-08-16 18:43 ` Nick Desaulniers
@ 2021-08-19  6:40 ` Tony Lindgren
  1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2021-08-19  6:40 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Nick Desaulniers, Gustavo A. R. Silva, Kees Cook, linux-omap,
	linux-kernel, clang-built-linux

* Nathan Chancellor <nathan@kernel.org> [210815 22:19]:
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-19  6:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15 19:18 [PATCH] bus: ti-sysc: Add break in switch statement in sysc_init_soc() Nathan Chancellor
2021-08-16 18:43 ` Nick Desaulniers
2021-08-19  6:40 ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).