diff options
author | Brian Behlendorf <[email protected]> | 2021-09-14 09:17:54 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2021-09-14 10:17:54 -0600 |
commit | 6954c22f35cc8182f76bd18ab259a7d3eaf40b65 (patch) | |
tree | 0397dcd7c2fb6dd73754d30e0ad61feeff62625c /lib/libzfs | |
parent | 7443299fe0b8caaadbfc18f778732bb26c899e41 (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 'lib/libzfs')
-rw-r--r-- | lib/libzfs/libzfs_dataset.c | 5 | ||||
-rw-r--r-- | lib/libzfs/libzfs_pool.c | 4 | ||||
-rw-r--r-- | lib/libzfs/libzfs_sendrecv.c | 2 | ||||
-rw-r--r-- | lib/libzfs/libzfs_util.c | 2 |
4 files changed, 6 insertions, 7 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 0e3198d9c..20251e9e7 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -1363,9 +1363,8 @@ badlabel: (void) zfs_error(hdl, EZFS_BADPROP, errbuf); goto error; } + fallthrough; } - /* FALLTHROUGH */ - case ZFS_PROP_SHARESMB: case ZFS_PROP_SHARENFS: @@ -3775,8 +3774,8 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type, if (type == ZFS_TYPE_VOLUME) return (zfs_error(hdl, EZFS_VOLTOOBIG, errbuf)); + fallthrough; #endif - /* FALLTHROUGH */ default: return (zfs_standard_error(hdl, errno, errbuf)); } diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 7338b9d72..57dea98cc 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -314,7 +314,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, len); break; } - /* FALLTHROUGH */ + fallthrough; default: (void) strlcpy(buf, "-", len); break; @@ -405,7 +405,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, (void) snprintf(buf, len, "-"); break; } - /* FALLTHROUGH */ + fallthrough; default: (void) snprintf(buf, len, "%llu", (u_longlong_t)intval); } diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 36a480d36..bee0aff4b 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -4866,7 +4866,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, (void) zfs_error(hdl, EZFS_BUSY, errbuf); break; } - /* fallthru */ + fallthrough; default: (void) zfs_standard_error(hdl, ioctl_errno, errbuf); } diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index 88d6561a5..c3c009ae3 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -598,7 +598,7 @@ zfs_setprop_error(libzfs_handle_t *hdl, zfs_prop_t prop, int err, break; } #endif - /* FALLTHROUGH */ + fallthrough; default: (void) zfs_standard_error(hdl, err, errbuf); } |