diff options
author | Brian Behlendorf <[email protected]> | 2021-09-14 09:17:54 -0700 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2021-11-02 09:50:30 -0700 |
commit | 143476ce8d3aa4595ce7040cb0aabd2fd0e13dc8 (patch) | |
tree | 90a138d1aa90344d341bcf94def34a0609662c93 /module/zfs | |
parent | d8a97a7be2ebd6eb305aba86ba7eec2ac0a4739b (diff) |
Use fallthrough macro
As of the Linux 5.9 kernel a fallthrough macro has been added which
should be used to anotate all intentional fallthrough paths. Once
all of the kernel code paths have been updated to use fallthrough
the -Wimplicit-fallthrough option will because the default. To
avoid warnings in the OpenZFS code base when this happens apply
the fallthrough macro.
Additional reading: https://lwn.net/Articles/794944/
Reviewed-by: Tony Nguyen <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #12441
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/abd.c | 8 | ||||
-rw-r--r-- | module/zfs/dsl_prop.c | 2 | ||||
-rw-r--r-- | module/zfs/spa.c | 2 | ||||
-rw-r--r-- | module/zfs/vdev_label.c | 2 | ||||
-rw-r--r-- | module/zfs/vdev_raidz_math_scalar.c | 2 | ||||
-rw-r--r-- | module/zfs/zfs_replay.c | 10 | ||||
-rw-r--r-- | module/zfs/zio_compress.c | 2 |
7 files changed, 13 insertions, 15 deletions
diff --git a/module/zfs/abd.c b/module/zfs/abd.c index cc2d3575d..03a7b1e03 100644 --- a/module/zfs/abd.c +++ b/module/zfs/abd.c @@ -1066,10 +1066,10 @@ abd_raidz_gen_iterate(abd_t **cabds, abd_t *dabd, switch (parity) { case 3: len = MIN(caiters[2].iter_mapsize, len); - /* falls through */ + fallthrough; case 2: len = MIN(caiters[1].iter_mapsize, len); - /* falls through */ + fallthrough; case 1: len = MIN(caiters[0].iter_mapsize, len); } @@ -1179,11 +1179,11 @@ abd_raidz_rec_iterate(abd_t **cabds, abd_t **tabds, case 3: len = MIN(xiters[2].iter_mapsize, len); len = MIN(citers[2].iter_mapsize, len); - /* falls through */ + fallthrough; case 2: len = MIN(xiters[1].iter_mapsize, len); len = MIN(citers[1].iter_mapsize, len); - /* falls through */ + fallthrough; case 1: len = MIN(xiters[0].iter_mapsize, len); len = MIN(citers[0].iter_mapsize, len); diff --git a/module/zfs/dsl_prop.c b/module/zfs/dsl_prop.c index f6ff9ae47..dfa04d768 100644 --- a/module/zfs/dsl_prop.c +++ b/module/zfs/dsl_prop.c @@ -749,7 +749,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds, const char *propname, ASSERT(err == 0 || err == ENOENT); err = zap_remove(mos, zapobj, inheritstr, tx); ASSERT(err == 0 || err == ENOENT); - /* FALLTHRU */ + fallthrough; case (ZPROP_SRC_NONE | ZPROP_SRC_RECEIVED): /* * remove propname$recvd diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 55870bee4..a02fd198b 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -9710,7 +9710,7 @@ spa_activity_in_progress(spa_t *spa, zpool_wait_activity_t activity, case ZPOOL_WAIT_RESILVER: if ((*in_progress = vdev_rebuild_active(spa->spa_root_vdev))) break; - /* fall through */ + fallthrough; case ZPOOL_WAIT_SCRUB: { boolean_t scanning, paused, is_scrub; diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c index 04202a9f8..ec6bbc6fc 100644 --- a/module/zfs/vdev_label.c +++ b/module/zfs/vdev_label.c @@ -1287,7 +1287,7 @@ vdev_label_read_bootenv(vdev_t *rvd, nvlist_t *bootenv) nvlist_free(config); break; } - /* FALLTHROUGH */ + fallthrough; default: /* Check for FreeBSD zfs bootonce command string */ buf = abd_to_buf(abd); diff --git a/module/zfs/vdev_raidz_math_scalar.c b/module/zfs/vdev_raidz_math_scalar.c index cd742e146..9e9c15ff4 100644 --- a/module/zfs/vdev_raidz_math_scalar.c +++ b/module/zfs/vdev_raidz_math_scalar.c @@ -142,7 +142,7 @@ static const struct { a.b[6] = mul_lt[a.b[6]]; \ a.b[5] = mul_lt[a.b[5]]; \ a.b[4] = mul_lt[a.b[4]]; \ - /* falls through */ \ + fallthrough; \ case 4: \ a.b[3] = mul_lt[a.b[3]]; \ a.b[2] = mul_lt[a.b[2]]; \ diff --git a/module/zfs/zfs_replay.c b/module/zfs/zfs_replay.c index cba5e8c9c..f3d209f1f 100644 --- a/module/zfs/zfs_replay.c +++ b/module/zfs/zfs_replay.c @@ -362,7 +362,7 @@ zfs_replay_create_acl(void *arg1, void *arg2, boolean_t byteswap) zfsvfs->z_fuid_replay = zfs_replay_fuids(fuidstart, (void *)&name, lracl->lr_fuidcnt, lracl->lr_domcnt, lr->lr_uid, lr->lr_gid); - /*FALLTHROUGH*/ + fallthrough; case TX_CREATE_ACL_ATTR: if (name == NULL) { lrattr = (lr_attr_t *)(caddr_t)(lracl + 1); @@ -394,7 +394,7 @@ zfs_replay_create_acl(void *arg1, void *arg2, boolean_t byteswap) zfsvfs->z_fuid_replay = zfs_replay_fuids(fuidstart, (void *)&name, lracl->lr_fuidcnt, lracl->lr_domcnt, lr->lr_uid, lr->lr_gid); - /*FALLTHROUGH*/ + fallthrough; case TX_MKDIR_ACL_ATTR: if (name == NULL) { lrattr = (lr_attr_t *)(caddr_t)(lracl + 1); @@ -519,8 +519,7 @@ zfs_replay_create(void *arg1, void *arg2, boolean_t byteswap) zfs_replay_fuid_domain(start, &start, lr->lr_uid, lr->lr_gid); name = (char *)start; - - /*FALLTHROUGH*/ + fallthrough; case TX_CREATE: if (name == NULL) name = (char *)start; @@ -537,8 +536,7 @@ zfs_replay_create(void *arg1, void *arg2, boolean_t byteswap) zfs_replay_fuid_domain(start, &start, lr->lr_uid, lr->lr_gid); name = (char *)start; - - /*FALLTHROUGH*/ + fallthrough; case TX_MKDIR: if (name == NULL) name = (char *)(lr + 1); diff --git a/module/zfs/zio_compress.c b/module/zfs/zio_compress.c index 33602bd47..1ff1e76d7 100644 --- a/module/zfs/zio_compress.c +++ b/module/zfs/zio_compress.c @@ -214,7 +214,7 @@ zio_compress_to_feature(enum zio_compress comp) case ZIO_COMPRESS_ZSTD: return (SPA_FEATURE_ZSTD_COMPRESS); default: - /* fallthru */; + break; } return (SPA_FEATURE_NONE); } |