From: "Darrick J. Wong" <djwong@kernel.org>
To: sandeen@sandeen.net, djwong@kernel.org
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 07/61] misc: convert utilities to use "fallthrough;"
Date: Wed, 15 Sep 2021 16:07:13 -0700 [thread overview]
Message-ID: <163174723300.350433.15350947081757255516.stgit@magnolia> (raw)
In-Reply-To: <163174719429.350433.8562606396437219220.stgit@magnolia>
From: Darrick J. Wong <djwong@kernel.org>
Now that we have a macro to virtualize switch statement fallthroughs for
lazy compiler linters, we might as well spread it elsewhere.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
db/type.c | 2 +-
growfs/xfs_growfs.c | 6 +++---
repair/dinode.c | 18 +++++++++---------
repair/phase4.c | 4 ++--
repair/scan.c | 4 ++--
scrub/inodes.c | 2 +-
scrub/repair.c | 2 +-
scrub/scrub.c | 8 ++++----
8 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/db/type.c b/db/type.c
index 572ac6d6..f8d8b555 100644
--- a/db/type.c
+++ b/db/type.c
@@ -307,7 +307,7 @@ handle_text(
{
switch (action) {
case DB_FUZZ:
- /* fall through */
+ fallthrough;
case DB_WRITE:
dbprintf(_("text writing/fuzzing not supported.\n"));
break;
diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c
index d45ba703..683961f6 100644
--- a/growfs/xfs_growfs.c
+++ b/growfs/xfs_growfs.c
@@ -78,7 +78,7 @@ main(int argc, char **argv)
switch (c) {
case 'D':
dsize = strtoll(optarg, NULL, 10);
- /* fall through */
+ fallthrough;
case 'd':
dflag = 1;
break;
@@ -91,7 +91,7 @@ main(int argc, char **argv)
break;
case 'L':
lsize = strtoll(optarg, NULL, 10);
- /* fall through */
+ fallthrough;
case 'l':
lflag = 1;
break;
@@ -107,7 +107,7 @@ main(int argc, char **argv)
break;
case 'R':
rsize = strtoll(optarg, NULL, 10);
- /* fall through */
+ fallthrough;
case 'r':
rflag = 1;
break;
diff --git a/repair/dinode.c b/repair/dinode.c
index 1fd20954..f39ab2dc 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -531,7 +531,7 @@ _("Fatal error: inode %" PRIu64 " - blkmap_set_ext(): %s\n"
do_warn(
_("%s fork in ino %" PRIu64 " claims free block %" PRIu64 "\n"),
forkname, ino, (uint64_t) b);
- /* fall through ... */
+ fallthrough;
case XR_E_INUSE1: /* seen by rmap */
case XR_E_UNKNOWN:
break;
@@ -543,7 +543,7 @@ _("%s fork in ino %" PRIu64 " claims free block %" PRIu64 "\n"),
case XR_E_INO1:
case XR_E_INUSE_FS1:
do_warn(_("rmap claims metadata use!\n"));
- /* fall through */
+ fallthrough;
case XR_E_FS_MAP:
case XR_E_INO:
case XR_E_INUSE_FS:
@@ -1674,9 +1674,9 @@ _("directory inode %" PRIu64 " has bad size %" PRId64 "\n"),
}
break;
- case XR_INO_CHRDEV: /* fall through to FIFO case ... */
- case XR_INO_BLKDEV: /* fall through to FIFO case ... */
- case XR_INO_SOCK: /* fall through to FIFO case ... */
+ case XR_INO_CHRDEV:
+ case XR_INO_BLKDEV:
+ case XR_INO_SOCK:
case XR_INO_FIFO:
if (process_misc_ino_types(mp, dino, lino, type))
return 1;
@@ -1751,8 +1751,8 @@ _("bad attr fork offset %d in dev inode %" PRIu64 ", should be %d\n"),
return 1;
}
break;
- case XFS_DINODE_FMT_LOCAL: /* fall through ... */
- case XFS_DINODE_FMT_EXTENTS: /* fall through ... */
+ case XFS_DINODE_FMT_LOCAL:
+ case XFS_DINODE_FMT_EXTENTS:
case XFS_DINODE_FMT_BTREE:
if (dino->di_forkoff >= (XFS_LITINO(mp) >> 3)) {
do_warn(
@@ -1908,7 +1908,7 @@ process_inode_data_fork(
totblocks, nextents, dblkmap, XFS_DATA_FORK,
check_dups);
break;
- case XFS_DINODE_FMT_DEV: /* fall through */
+ case XFS_DINODE_FMT_DEV:
err = 0;
break;
default:
@@ -1946,7 +1946,7 @@ process_inode_data_fork(
dirty, totblocks, nextents, dblkmap,
XFS_DATA_FORK, 0);
break;
- case XFS_DINODE_FMT_DEV: /* fall through */
+ case XFS_DINODE_FMT_DEV:
err = 0;
break;
default:
diff --git a/repair/phase4.c b/repair/phase4.c
index 191b4842..eb043002 100644
--- a/repair/phase4.c
+++ b/repair/phase4.c
@@ -317,7 +317,7 @@ phase4(xfs_mount_t *mp)
do_warn(
_("unknown block state, ag %d, blocks %u-%u\n"),
i, j, j + blen - 1);
- /* fall through .. */
+ fallthrough;
case XR_E_UNKNOWN:
case XR_E_FREE:
case XR_E_INUSE:
@@ -349,7 +349,7 @@ phase4(xfs_mount_t *mp)
do_warn(
_("unknown rt extent state, extent %" PRIu64 "\n"),
bno);
- /* fall through .. */
+ fallthrough;
case XR_E_UNKNOWN:
case XR_E_FREE1:
case XR_E_FREE:
diff --git a/repair/scan.c b/repair/scan.c
index 2c25af57..52de8a04 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -732,7 +732,7 @@ _("%s freespace btree block claimed (state %d), agno %d, bno %d, suspect %d\n"),
XR_E_FREE);
break;
}
- /* fall through */
+ fallthrough;
default:
do_warn(
_("block (%d,%d-%d) multiply claimed by %s space tree, state - %d\n"),
@@ -911,7 +911,7 @@ _("in use block (%d,%d-%d) mismatch in %s tree, state - %d,%" PRIx64 "\n"),
if (xfs_sb_version_hasreflink(&mp->m_sb) &&
!XFS_RMAP_NON_INODE_OWNER(owner))
break;
- /* fall through */
+ fallthrough;
default:
do_warn(
_("unknown block (%d,%d-%d) mismatch on %s tree, state - %d,%" PRIx64 "\n"),
diff --git a/scrub/inodes.c b/scrub/inodes.c
index cc73da7f..80af8a74 100644
--- a/scrub/inodes.c
+++ b/scrub/inodes.c
@@ -204,7 +204,7 @@ _("Changed too many times during scan; giving up."));
}
case ECANCELED:
error = 0;
- /* fall thru */
+ fallthrough;
default:
goto err;
}
diff --git a/scrub/repair.c b/scrub/repair.c
index 2c1644c3..1ef6372e 100644
--- a/scrub/repair.c
+++ b/scrub/repair.c
@@ -133,7 +133,7 @@ action_list_find_mustfix(
alist->nr--;
list_move_tail(&aitem->list, &immediate_alist->list);
immediate_alist->nr++;
- /* fall through */
+ fallthrough;
case XFS_SCRUB_TYPE_BNOBT:
case XFS_SCRUB_TYPE_CNTBT:
case XFS_SCRUB_TYPE_REFCNTBT:
diff --git a/scrub/scrub.c b/scrub/scrub.c
index aec2d5d5..a4b7084e 100644
--- a/scrub/scrub.c
+++ b/scrub/scrub.c
@@ -164,7 +164,7 @@ _("Filesystem is shut down, aborting."));
* and the other two should be reported via sm_flags.
*/
str_liberror(ctx, error, _("Kernel bug"));
- /* fall through */
+ fallthrough;
default:
/* Operational error. */
str_errno(ctx, descr_render(&dsc));
@@ -316,7 +316,7 @@ scrub_meta_type(
ret = scrub_save_repair(ctx, alist, &meta);
if (ret)
return ret;
- /* fall through */
+ fallthrough;
case CHECK_DONE:
return 0;
default:
@@ -741,7 +741,7 @@ _("Filesystem is shut down, aborting."));
if (is_unoptimized(&oldm) ||
debug_tweak_on("XFS_SCRUB_FORCE_REPAIR"))
return CHECK_DONE;
- /* fall through */
+ fallthrough;
case EINVAL:
/* Kernel doesn't know how to repair this? */
str_corrupt(ctx, descr_render(&dsc),
@@ -761,7 +761,7 @@ _("Read-only filesystem; cannot make changes."));
/* Don't care if preen fails due to low resources. */
if (is_unoptimized(&oldm) && !needs_repair(&oldm))
return CHECK_DONE;
- /* fall through */
+ fallthrough;
default:
/*
* Operational error. If the caller doesn't want us
next prev parent reply other threads:[~2021-09-15 23:07 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-15 23:06 [PATCHSET 00/61] xfs: sync libxfs with 5.14 Darrick J. Wong
2021-09-15 23:06 ` [PATCH 01/61] mkfs: move mkfs/proto.c declarations to mkfs/proto.h Darrick J. Wong
2021-09-16 7:24 ` Christoph Hellwig
2021-09-15 23:06 ` [PATCH 02/61] libfrog: move topology.[ch] to libxfs Darrick J. Wong
2021-09-16 7:26 ` Christoph Hellwig
2021-09-15 23:06 ` [PATCH 03/61] libfrog: create header file for mocked-up kernel data structures Darrick J. Wong
2021-09-16 0:46 ` Dave Chinner
2021-09-16 0:58 ` Darrick J. Wong
2021-09-16 1:29 ` Dave Chinner
2021-09-16 1:37 ` Dave Chinner
2021-09-16 1:46 ` [PATCH 0/5] xfsprogs: generic serialisation primitives Dave Chinner
2021-09-16 1:46 ` [PATCH 1/5] xfsprogs: introduce liburcu support Dave Chinner
2021-09-24 0:41 ` Eric Sandeen
2021-09-24 3:02 ` Chandan Babu R
2021-09-16 1:46 ` [PATCH 2/5] libxfs: add spinlock_t wrapper Dave Chinner
2021-09-16 1:46 ` [PATCH 3/5] atomic: convert to uatomic Dave Chinner
2021-09-16 1:46 ` [PATCH 4/5] libxfs: add kernel-compatible completion API Dave Chinner
2021-09-16 1:46 ` [PATCH 5/5] libxfs: add wrappers for kernel semaphores Dave Chinner
2021-09-22 22:08 ` [PATCH 0/5] xfsprogs: generic serialisation primitives Eric Sandeen
2021-09-23 8:47 ` [External] : " Chandan Babu R
2021-09-16 16:23 ` [PATCH 03/61] libfrog: create header file for mocked-up kernel data structures Eric Sandeen
2021-09-15 23:06 ` [PATCH 04/61] libxfs: port xfs_set_inode_alloc from the kernel Darrick J. Wong
2021-10-01 17:54 ` Eric Sandeen
2021-09-15 23:07 ` [PATCH 05/61] libxfs: fix whitespace inconsistencies with kernel Darrick J. Wong
2021-10-01 19:06 ` Eric Sandeen
2021-09-15 23:07 ` [PATCH 06/61] xfs: Fix fall-through warnings for Clang Darrick J. Wong
2021-10-01 19:57 ` Eric Sandeen
2021-09-15 23:07 ` Darrick J. Wong [this message]
2021-10-01 19:10 ` [PATCH 07/61] misc: convert utilities to use "fallthrough;" Eric Sandeen
2021-09-15 23:07 ` [PATCH 08/61] xfs: use xfs_buf_alloc_pages for uncached buffers Darrick J. Wong
2021-09-15 23:07 ` [PATCH 09/61] xfs: Reverse apply 72b97ea40d Darrick J. Wong
2021-09-15 23:07 ` [PATCH 10/61] xfs: Add xfs_attr_node_remove_name Darrick J. Wong
2021-09-15 23:07 ` [PATCH 11/61] xfs: Refactor xfs_attr_set_shortform Darrick J. Wong
2021-09-15 23:07 ` [PATCH 12/61] xfs: Separate xfs_attr_node_addname and xfs_attr_node_addname_clear_incomplete Darrick J. Wong
2021-09-15 23:07 ` [PATCH 13/61] xfs: Add helper xfs_attr_node_addname_find_attr Darrick J. Wong
2021-09-15 23:07 ` [PATCH 14/61] xfs: Hoist xfs_attr_node_addname Darrick J. Wong
2021-09-15 23:07 ` [PATCH 15/61] xfs: Hoist xfs_attr_leaf_addname Darrick J. Wong
2021-09-15 23:08 ` [PATCH 16/61] xfs: Hoist node transaction handling Darrick J. Wong
2021-09-15 23:08 ` [PATCH 17/61] xfs: Add delay ready attr remove routines Darrick J. Wong
2021-09-15 23:08 ` [PATCH 18/61] xfs: Add delay ready attr set routines Darrick J. Wong
2021-09-15 23:08 ` [PATCH 19/61] xfs: Remove xfs_attr_rmtval_set Darrick J. Wong
2021-09-15 23:08 ` [PATCH 20/61] xfs: Clean up xfs_attr_node_addname_clear_incomplete Darrick J. Wong
2021-09-15 23:08 ` [PATCH 21/61] xfs: clean up open-coded fs block unit conversions Darrick J. Wong
2021-09-15 23:08 ` [PATCH 22/61] xfs: move xfs_perag_get/put to xfs_ag.[ch] Darrick J. Wong
2021-09-15 23:08 ` [PATCH 23/61] xfs: move perag structure and setup to libxfs/xfs_ag.[ch] Darrick J. Wong
2021-09-15 23:08 ` [PATCH 24/61] xfs: make for_each_perag... a first class citizen Darrick J. Wong
2021-09-15 23:08 ` [PATCH 25/61] xfs: convert raw ag walks to use for_each_perag Darrick J. Wong
2021-09-15 23:08 ` [PATCH 26/61] xfs: convert xfs_iwalk to use perag references Darrick J. Wong
2021-09-15 23:09 ` [PATCH 27/61] xfs: convert secondary superblock walk to use perags Darrick J. Wong
2021-09-15 23:09 ` [PATCH 28/61] xfs: pass perags through to the busy extent code Darrick J. Wong
2021-09-15 23:09 ` [PATCH 29/61] xfs: push perags through the ag reservation callouts Darrick J. Wong
2021-09-15 23:09 ` [PATCH 30/61] xfs: pass perags around in fsmap data dev functions Darrick J. Wong
2021-09-15 23:09 ` [PATCH 31/61] xfs: add a perag to the btree cursor Darrick J. Wong
2021-09-15 23:09 ` [PATCH 32/61] xfs: convert rmap btree cursor to using a perag Darrick J. Wong
2021-09-15 23:09 ` [PATCH 33/61] xfs: convert refcount btree cursor to use perags Darrick J. Wong
2021-09-15 23:09 ` [PATCH 34/61] xfs: convert allocbt cursors " Darrick J. Wong
2021-09-15 23:09 ` [PATCH 35/61] xfs: use perag for ialloc btree cursors Darrick J. Wong
2021-09-15 23:09 ` [PATCH 36/61] xfs: remove agno from btree cursor Darrick J. Wong
2021-09-15 23:09 ` [PATCH 37/61] xfs: simplify xfs_dialloc_select_ag() return values Darrick J. Wong
2021-09-15 23:10 ` [PATCH 38/61] xfs: collapse AG selection for inode allocation Darrick J. Wong
2021-09-15 23:10 ` [PATCH 39/61] xfs: get rid of xfs_dir_ialloc() Darrick J. Wong
2021-09-15 23:10 ` [PATCH 40/61] xfs: inode allocation can use a single perag instance Darrick J. Wong
2021-09-15 23:10 ` [PATCH 41/61] xfs: clean up and simplify xfs_dialloc() Darrick J. Wong
2021-09-15 23:10 ` [PATCH 42/61] xfs: use perag through unlink processing Darrick J. Wong
2021-09-15 23:10 ` [PATCH 43/61] xfs: remove xfs_perag_t Darrick J. Wong
2021-09-15 23:10 ` [PATCH 44/61] xfs: sort variable alphabetically to avoid repeated declaration Darrick J. Wong
2021-09-15 23:10 ` [PATCH 45/61] xfs: Remove redundant assignment to busy Darrick J. Wong
2021-09-15 23:10 ` [PATCH 46/61] xfs: mark xfs_bmap_set_attrforkoff static Darrick J. Wong
2021-09-15 23:10 ` [PATCH 47/61] xfs: fix radix tree tag signs Darrick J. Wong
2021-09-15 23:10 ` [PATCH 48/61] xfs: drop the AGI being passed to xfs_check_agi_freecount Darrick J. Wong
2021-09-15 23:11 ` [PATCH 49/61] xfs: Fix default ASSERT in xfs_attr_set_iter Darrick J. Wong
2021-09-15 23:11 ` [PATCH 50/61] xfs: Make attr name schemes consistent Darrick J. Wong
2021-09-15 23:11 ` [PATCH 51/61] xfs: perag may be null in xfs_imap() Darrick J. Wong
2021-09-15 23:11 ` [PATCH 52/61] xfs: log stripe roundoff is a property of the log Darrick J. Wong
2021-09-15 23:11 ` [PATCH 53/61] xfs: xfs_log_force_lsn isn't passed a LSN Darrick J. Wong
2021-09-15 23:11 ` [PATCH 54/61] xfs: fix endianness issue in xfs_ag_shrink_space Darrick J. Wong
2021-09-15 23:11 ` [PATCH 55/61] xfs: Initialize error in xfs_attr_remove_iter Darrick J. Wong
2021-09-15 23:11 ` [PATCH 56/61] xfs: Fix multiple fall-through warnings for Clang Darrick J. Wong
2021-09-15 23:11 ` [PATCH 57/61] xfs: check for sparse inode clusters that cross new EOAG when shrinking Darrick J. Wong
2021-09-15 23:11 ` [PATCH 58/61] xfs: correct the narrative around misaligned rtinherit/extszinherit dirs Darrick J. Wong
2021-09-15 23:11 ` [PATCH 59/61] xfs: logging the on disk inode LSN can make it go backwards Darrick J. Wong
2021-09-15 23:12 ` [PATCH 60/61] xfs_db: convert the agresv command to use for_each_perag Darrick J. Wong
2021-09-16 7:20 ` Christoph Hellwig
2021-09-15 23:12 ` [PATCH 61/61] mkfs: warn about V4 deprecation when creating new V4 filesystems Darrick J. Wong
2021-09-16 7:18 ` Christoph Hellwig
2021-09-16 15:10 ` Darrick J. Wong
2021-09-16 15:15 ` Christoph Hellwig
2021-11-04 2:25 ` Darrick J. Wong
2021-11-04 2:30 ` Eric Sandeen
2021-09-15 23:36 ` [PATCHSET 00/61] xfs: sync libxfs with 5.14 Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=163174723300.350433.15350947081757255516.stgit@magnolia \
--to=djwong@kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).