public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] adfs: mark expected switch fall-throughs
@ 2019-01-14 20:35 Gustavo A. R. Silva
  2019-01-15 22:25 ` Stephen Rothwell
  2019-04-09  0:13 ` Kees Cook
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-14 20:35 UTC (permalink / raw)
  To: Stephen Rothwell, Kees Cook; +Cc: linux-kernel, Gustavo A. R. Silva

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

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

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

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 fs/adfs/dir_f.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/adfs/dir_f.c b/fs/adfs/dir_f.c
index 0fbfd0b04ae0..382c9d7ad375 100644
--- a/fs/adfs/dir_f.c
+++ b/fs/adfs/dir_f.c
@@ -24,8 +24,11 @@ static inline unsigned int adfs_readval(unsigned char *p, int len)
 
 	switch (len) {
 	case 4:		val |= p[3] << 24;
+			/* fall through */
 	case 3:		val |= p[2] << 16;
+			/* fall through */
 	case 2:		val |= p[1] << 8;
+			/* fall through */
 	default:	val |= p[0];
 	}
 	return val;
@@ -35,8 +38,11 @@ static inline void adfs_writeval(unsigned char *p, int len, unsigned int val)
 {
 	switch (len) {
 	case 4:		p[3] = val >> 24;
+			/* fall through */
 	case 3:		p[2] = val >> 16;
+			/* fall through */
 	case 2:		p[1] = val >> 8;
+			/* fall through */
 	default:	p[0] = val;
 	}
 }
-- 
2.20.1


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

* Re: [PATCH] adfs: mark expected switch fall-throughs
  2019-01-14 20:35 [PATCH] adfs: mark expected switch fall-throughs Gustavo A. R. Silva
@ 2019-01-15 22:25 ` Stephen Rothwell
  2019-04-09  0:13 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2019-01-15 22:25 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: Kees Cook, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

Hi Gustavo,

On Mon, 14 Jan 2019 14:35:07 -0600 "Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:
>
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Warning level 3 was used: -Wimplicit-fallthrough=3
> 
> This patch is part of the ongoing efforts to enabling
> -Wimplicit-fallthrough
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>  fs/adfs/dir_f.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Added to my fixes tree.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] adfs: mark expected switch fall-throughs
  2019-01-14 20:35 [PATCH] adfs: mark expected switch fall-throughs Gustavo A. R. Silva
  2019-01-15 22:25 ` Stephen Rothwell
@ 2019-04-09  0:13 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2019-04-09  0:13 UTC (permalink / raw)
  To: Gustavo A. R. Silva; +Cc: Stephen Rothwell, LKML

On Mon, Jan 14, 2019 at 12:35 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> Warning level 3 was used: -Wimplicit-fallthrough=3
>
> This patch is part of the ongoing efforts to enabling
> -Wimplicit-fallthrough
>
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Please consider this reviewed! :)

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

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

end of thread, other threads:[~2019-04-09  0:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-14 20:35 [PATCH] adfs: mark expected switch fall-throughs Gustavo A. R. Silva
2019-01-15 22:25 ` Stephen Rothwell
2019-04-09  0:13 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox