mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] fs: annotate implicit fall throughs
@ 2019-01-14 20:38 Mathieu Malaterre
  2019-01-14 20:38 ` [PATCH 2/3] fs: annotate implicit fall through Mathieu Malaterre
  2019-01-14 20:38 ` [PATCH 3/3] fs/fcntl: " Mathieu Malaterre
  0 siblings, 2 replies; 3+ messages in thread
From: Mathieu Malaterre @ 2019-01-14 20:38 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Mathieu Malaterre, Jeff Layton, J. Bruce Fields, linux-fsdevel,
	linux-kernel

There is a plan to build the kernel with -Wimplicit-fallthrough and
these places in the code produced warnings (W=1). Fix them up.

This commit remove the following warnings:

  fs/libfs.c:148:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
  fs/libfs.c:150:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 fs/libfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/libfs.c b/fs/libfs.c
index 0fb590d79f30..9efb647917e0 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -146,9 +146,11 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)
 	switch (whence) {
 		case 1:
 			offset += file->f_pos;
+			/* fall through */
 		case 0:
 			if (offset >= 0)
 				break;
+			/* fall through */
 		default:
 			return -EINVAL;
 	}
-- 
2.19.2


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

* [PATCH 2/3] fs: annotate implicit fall through
  2019-01-14 20:38 [PATCH 1/3] fs: annotate implicit fall throughs Mathieu Malaterre
@ 2019-01-14 20:38 ` Mathieu Malaterre
  2019-01-14 20:38 ` [PATCH 3/3] fs/fcntl: " Mathieu Malaterre
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Malaterre @ 2019-01-14 20:38 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Mathieu Malaterre, Jeff Layton, J. Bruce Fields, linux-fsdevel,
	linux-kernel

There is a plan to build the kernel with -Wimplicit-fallthrough and
this place in the code produced a warning (W=1).

In this particular case remove a ‘:’ so as to match the regular
expression expected by GCC.

This commit remove the following warning:

  fs/locks.c:1473:16: warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 fs/locks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/locks.c b/fs/locks.c
index ff6af2c32601..d958c3863b4b 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1471,7 +1471,7 @@ static void lease_clear_pending(struct file_lock *fl, int arg)
 	switch (arg) {
 	case F_UNLCK:
 		fl->fl_flags &= ~FL_UNLOCK_PENDING;
-		/* fall through: */
+		/* fall through */
 	case F_RDLCK:
 		fl->fl_flags &= ~FL_DOWNGRADE_PENDING;
 	}
-- 
2.19.2


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

* [PATCH 3/3] fs/fcntl: annotate implicit fall through
  2019-01-14 20:38 [PATCH 1/3] fs: annotate implicit fall throughs Mathieu Malaterre
  2019-01-14 20:38 ` [PATCH 2/3] fs: annotate implicit fall through Mathieu Malaterre
@ 2019-01-14 20:38 ` Mathieu Malaterre
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Malaterre @ 2019-01-14 20:38 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Mathieu Malaterre, Jeff Layton, J. Bruce Fields, linux-fsdevel,
	linux-kernel

There is a plan to build the kernel with -Wimplicit-fallthrough and
this place in the code produced a warning (W=1).

In this particular case change a ‘:’ with a ‘-’ so as to match the
regular expression expected by GCC.

This commit remove the following warning:

  fs/fcntl.c:770:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 fs/fcntl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fcntl.c b/fs/fcntl.c
index 083185174c6d..3d40771e8e7c 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -769,7 +769,7 @@ static void send_sigio_to_task(struct task_struct *p,
 			si.si_fd    = fd;
 			if (!do_send_sig_info(signum, &si, p, type))
 				break;
-		/* fall-through: fall back on the old plain SIGIO signal */
+		/* fall-through - fall back on the old plain SIGIO signal */
 		case 0:
 			do_send_sig_info(SIGIO, SEND_SIG_PRIV, p, type);
 	}
-- 
2.19.2


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

end of thread, other threads:[~2019-01-14 20:39 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:38 [PATCH 1/3] fs: annotate implicit fall throughs Mathieu Malaterre
2019-01-14 20:38 ` [PATCH 2/3] fs: annotate implicit fall through Mathieu Malaterre
2019-01-14 20:38 ` [PATCH 3/3] fs/fcntl: " Mathieu Malaterre

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

all inboxes | Powered by JetHome®