From 1f182103aaf504669923f037ba49629201304263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 12 Dec 2021 15:38:17 +0100 Subject: [PATCH] libzfs: fix unused, remove argsused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #12844 --- lib/libzfs/libzfs_changelist.c | 4 ++-- lib/libzfs/libzfs_config.c | 6 ++---- lib/libzfs/libzfs_crypto.c | 12 +++++++----- lib/libzfs/libzfs_dataset.c | 1 + lib/libzfs/libzfs_iter.c | 5 +++-- lib/libzfs/libzfs_mount.c | 9 ++++----- lib/libzfs/libzfs_status.c | 12 ++++++------ lib/libzfs/os/freebsd/libzfs_zmount.c | 3 +++ lib/libzfs/os/linux/libzfs_mount_os.c | 4 ++++ lib/libzfs/os/linux/libzfs_util_os.c | 1 + module/zcommon/zfs_fletcher.c | 9 ++++----- 11 files changed, 37 insertions(+), 29 deletions(-) diff --git a/lib/libzfs/libzfs_changelist.c b/lib/libzfs/libzfs_changelist.c index cb0b0fd0db..645a0fbefb 100644 --- a/lib/libzfs/libzfs_changelist.c +++ b/lib/libzfs/libzfs_changelist.c @@ -592,7 +592,6 @@ compare_props(const void *a, const void *b, zfs_prop_t prop) return (strcmp(propb, propa)); } -/*ARGSUSED*/ static int compare_mountpoints(const void *a, const void *b, void *unused) { @@ -602,13 +601,14 @@ compare_mountpoints(const void *a, const void *b, void *unused) * hierarchy that is different from the dataset hierarchy, and still * allow it to be changed. */ + (void) unused; return (compare_props(a, b, ZFS_PROP_MOUNTPOINT)); } -/*ARGSUSED*/ static int compare_dataset_names(const void *a, const void *b, void *unused) { + (void) unused; return (compare_props(a, b, ZFS_PROP_NAME)); } diff --git a/lib/libzfs/libzfs_config.c b/lib/libzfs/libzfs_config.c index a3ecc4a327..dd59015966 100644 --- a/lib/libzfs/libzfs_config.c +++ b/lib/libzfs/libzfs_config.c @@ -56,16 +56,14 @@ typedef struct config_node { uu_avl_node_t cn_avl; } config_node_t; -/* ARGSUSED */ static int config_node_compare(const void *a, const void *b, void *unused) { - int ret; - + (void) unused; const config_node_t *ca = (config_node_t *)a; const config_node_t *cb = (config_node_t *)b; - ret = strcmp(ca->cn_name, cb->cn_name); + int ret = strcmp(ca->cn_name, cb->cn_name); if (ret < 0) return (-1); diff --git a/lib/libzfs/libzfs_crypto.c b/lib/libzfs/libzfs_crypto.c index f55c1c957d..464a7f0fc3 100644 --- a/lib/libzfs/libzfs_crypto.c +++ b/lib/libzfs/libzfs_crypto.c @@ -482,6 +482,7 @@ get_key_material_file(libzfs_handle_t *hdl, const char *uri, const char *fsname, zfs_keyformat_t keyformat, boolean_t newkey, uint8_t **restrict buf, size_t *restrict len_out) { + (void) fsname, (void) newkey; FILE *f = NULL; int ret = 0; @@ -508,6 +509,7 @@ get_key_material_https(libzfs_handle_t *hdl, const char *uri, const char *fsname, zfs_keyformat_t keyformat, boolean_t newkey, uint8_t **restrict buf, size_t *restrict len_out) { + (void) fsname, (void) newkey; int ret = 0; FILE *key = NULL; boolean_t is_http = strncmp(uri, "http:", strlen("http:")) == 0; @@ -773,7 +775,7 @@ error: static int derive_key(libzfs_handle_t *hdl, zfs_keyformat_t format, uint64_t iters, - uint8_t *key_material, size_t key_material_len, uint64_t salt, + uint8_t *key_material, uint64_t salt, uint8_t **key_out) { int ret; @@ -916,8 +918,7 @@ populate_create_encryption_params_nvlists(libzfs_handle_t *hdl, } /* derive a key from the key material */ - ret = derive_key(hdl, keyformat, iters, key_material, key_material_len, - salt, &key_data); + ret = derive_key(hdl, keyformat, iters, key_material, salt, &key_data); if (ret != 0) goto error; @@ -1175,6 +1176,7 @@ int zfs_crypto_clone_check(libzfs_handle_t *hdl, zfs_handle_t *origin_zhp, char *parent_name, nvlist_t *props) { + (void) origin_zhp, (void) parent_name; char errbuf[1024]; (void) snprintf(errbuf, sizeof (errbuf), @@ -1372,8 +1374,8 @@ try_again: goto error; /* derive a key from the key material */ - ret = derive_key(zhp->zfs_hdl, keyformat, iters, key_material, - key_material_len, salt, &key_data); + ret = derive_key(zhp->zfs_hdl, keyformat, iters, key_material, salt, + &key_data); if (ret != 0) goto error; diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 2b0bba47ab..fb99abfe39 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -3180,6 +3180,7 @@ userquota_propname_decode(const char *propname, boolean_t zoned, if (errno != 0 || *end != '\0') return (EINVAL); #else + (void) domainlen; return (ENOSYS); #endif /* HAVE_IDMAP */ } else { diff --git a/lib/libzfs/libzfs_iter.c b/lib/libzfs/libzfs_iter.c index 0e9d972017..2e9ebf42fb 100644 --- a/lib/libzfs/libzfs_iter.c +++ b/lib/libzfs/libzfs_iter.c @@ -39,7 +39,7 @@ #include "libzfs_impl.h" static int -zfs_iter_clones(zfs_handle_t *zhp, int flags, zfs_iter_f func, void *data) +zfs_iter_clones(zfs_handle_t *zhp, zfs_iter_f func, void *data) { nvlist_t *nvl = zfs_get_clones_nvl(zhp); nvpair_t *pair; @@ -206,6 +206,7 @@ zfs_iter_snapshots(zfs_handle_t *zhp, int flags, zfs_iter_f func, int zfs_iter_bookmarks(zfs_handle_t *zhp, int flags, zfs_iter_f func, void *data) { + (void) flags; zfs_handle_t *nzhp; nvlist_t *props = NULL; nvlist_t *bmarks = NULL; @@ -496,7 +497,7 @@ iter_dependents_cb(zfs_handle_t *zhp, void *arg) ida->first = B_FALSE; if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) { - err = zfs_iter_clones(zhp, ida->flags, iter_dependents_cb, ida); + err = zfs_iter_clones(zhp, iter_dependents_cb, ida); } else if (zhp->zfs_type != ZFS_TYPE_BOOKMARK) { iter_stack_frame_t isf; iter_stack_frame_t *f; diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index 62fed92fa9..fca7455f42 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -244,12 +244,11 @@ zfs_is_mounted(zfs_handle_t *zhp, char **where) * Checks any higher order concerns about whether the given dataset is * mountable, false otherwise. zfs_is_mountable_internal specifically assumes * that the caller has verified the sanity of mounting the dataset at - * mountpoint to the extent the caller wants. + * its mountpoint to the extent the caller wants. */ static boolean_t -zfs_is_mountable_internal(zfs_handle_t *zhp, const char *mountpoint) +zfs_is_mountable_internal(zfs_handle_t *zhp) { - if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) && getzoneid() == GLOBAL_ZONEID) return (B_FALSE); @@ -282,7 +281,7 @@ zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t buflen, if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF) return (B_FALSE); - if (!zfs_is_mountable_internal(zhp, buf)) + if (!zfs_is_mountable_internal(zhp)) return (B_FALSE); if (zfs_prop_get_int(zhp, ZFS_PROP_REDACTED) && !(flags & MS_FORCE)) @@ -402,7 +401,7 @@ zfs_mount_at(zfs_handle_t *zhp, const char *options, int flags, remount = 1; /* Potentially duplicates some checks if invoked by zfs_mount(). */ - if (!zfs_is_mountable_internal(zhp, mountpoint)) + if (!zfs_is_mountable_internal(zhp)) return (0); /* diff --git a/lib/libzfs/libzfs_status.c b/lib/libzfs/libzfs_status.c index 33d6e1bfdf..b7713b2bfe 100644 --- a/lib/libzfs/libzfs_status.c +++ b/lib/libzfs/libzfs_status.c @@ -96,48 +96,48 @@ static char *zfs_msgid_table[] = { #define NMSGID (sizeof (zfs_msgid_table) / sizeof (zfs_msgid_table[0])) -/* ARGSUSED */ static int vdev_missing(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_CANT_OPEN && vs->vs_aux == VDEV_AUX_OPEN_FAILED); } -/* ARGSUSED */ static int vdev_faulted(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_FAULTED); } -/* ARGSUSED */ static int vdev_errors(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_DEGRADED || vs->vs_read_errors != 0 || vs->vs_write_errors != 0 || vs->vs_checksum_errors != 0); } -/* ARGSUSED */ static int vdev_broken(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_CANT_OPEN); } -/* ARGSUSED */ static int vdev_offlined(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_OFFLINE); } -/* ARGSUSED */ static int vdev_removed(vdev_stat_t *vs, uint_t vsc) { + (void) vsc; return (vs->vs_state == VDEV_STATE_REMOVED); } diff --git a/lib/libzfs/os/freebsd/libzfs_zmount.c b/lib/libzfs/os/freebsd/libzfs_zmount.c index 12317fdde3..79a8fe111f 100644 --- a/lib/libzfs/os/freebsd/libzfs_zmount.c +++ b/lib/libzfs/os/freebsd/libzfs_zmount.c @@ -123,6 +123,7 @@ do_mount(zfs_handle_t *zhp, const char *mntpt, char *opts, int flags) int do_unmount(zfs_handle_t *zhp, const char *mntpt, int flags) { + (void) zhp; if (unmount(mntpt, flags) < 0) return (errno); return (0); @@ -138,10 +139,12 @@ zfs_mount_delegation_check(void) void zpool_disable_datasets_os(zpool_handle_t *zhp, boolean_t force) { + (void) zhp, (void) force; } /* Called from the tail end of zfs_unmount() */ void zpool_disable_volume_os(const char *name) { + (void) name; } diff --git a/lib/libzfs/os/linux/libzfs_mount_os.c b/lib/libzfs/os/linux/libzfs_mount_os.c index 29fea736b6..e4fe8181bd 100644 --- a/lib/libzfs/os/linux/libzfs_mount_os.c +++ b/lib/libzfs/os/linux/libzfs_mount_os.c @@ -376,6 +376,8 @@ do_mount(zfs_handle_t *zhp, const char *mntpt, char *opts, int flags) int do_unmount(zfs_handle_t *zhp, const char *mntpt, int flags) { + (void) zhp; + if (!libzfs_envvar_is_set("ZFS_MOUNT_HELPER")) { int rv = umount2(mntpt, flags); @@ -416,10 +418,12 @@ zfs_mount_delegation_check(void) void zpool_disable_datasets_os(zpool_handle_t *zhp, boolean_t force) { + (void) zhp, (void) force; } /* Called from the tail end of zfs_unmount() */ void zpool_disable_volume_os(const char *name) { + (void) name; } diff --git a/lib/libzfs/os/linux/libzfs_util_os.c b/lib/libzfs/os/linux/libzfs_util_os.c index 2ac31f1077..a32aa1513b 100644 --- a/lib/libzfs/os/linux/libzfs_util_os.c +++ b/lib/libzfs/os/linux/libzfs_util_os.c @@ -187,6 +187,7 @@ find_shares_object(differ_info_t *di) int zfs_destroy_snaps_nvl_os(libzfs_handle_t *hdl, nvlist_t *snaps) { + (void) hdl, (void) snaps; return (0); } diff --git a/module/zcommon/zfs_fletcher.c b/module/zcommon/zfs_fletcher.c index 7a9de4a430..e7a8553f3f 100644 --- a/module/zcommon/zfs_fletcher.c +++ b/module/zcommon/zfs_fletcher.c @@ -226,7 +226,6 @@ static struct fletcher_4_kstat { /* Indicate that benchmark has been completed */ static boolean_t fletcher_4_initialized = B_FALSE; -/*ARGSUSED*/ void fletcher_init(zio_cksum_t *zcp) { @@ -258,11 +257,11 @@ fletcher_2_incremental_native(void *buf, size_t size, void *data) return (0); } -/*ARGSUSED*/ void fletcher_2_native(const void *buf, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; fletcher_init(zcp); (void) fletcher_2_incremental_native((void *) buf, size, zcp); } @@ -292,11 +291,11 @@ fletcher_2_incremental_byteswap(void *buf, size_t size, void *data) return (0); } -/*ARGSUSED*/ void fletcher_2_byteswap(const void *buf, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; fletcher_init(zcp); (void) fletcher_2_incremental_byteswap((void *) buf, size, zcp); } @@ -460,11 +459,11 @@ fletcher_4_native_impl(const void *buf, uint64_t size, zio_cksum_t *zcp) ops->fini_native(&ctx, zcp); } -/*ARGSUSED*/ void fletcher_4_native(const void *buf, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; const uint64_t p2size = P2ALIGN(size, FLETCHER_MIN_SIMD_SIZE); ASSERT(IS_P2ALIGNED(size, sizeof (uint32_t))); @@ -502,11 +501,11 @@ fletcher_4_byteswap_impl(const void *buf, uint64_t size, zio_cksum_t *zcp) ops->fini_byteswap(&ctx, zcp); } -/*ARGSUSED*/ void fletcher_4_byteswap(const void *buf, uint64_t size, const void *ctx_template, zio_cksum_t *zcp) { + (void) ctx_template; const uint64_t p2size = P2ALIGN(size, FLETCHER_MIN_SIMD_SIZE); ASSERT(IS_P2ALIGNED(size, sizeof (uint32_t)));