diff options
author | Brian Behlendorf <[email protected]> | 2017-12-07 17:12:40 -0500 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-01-09 12:28:03 -0800 |
commit | bfe27ace0de64838d50ff351396423a481de6c84 (patch) | |
tree | 0a94ed1858f160064f95a4b6c5caacbbe2e68820 | |
parent | 06401e42221d2f5130065caf70f8276ba4d19acd (diff) |
Fix unused variable warnings
Resolved unused variable warnings observed after restricting
-Wno-unused-but-set-variable to only libzfs and libzpool.
Reviewed-by: DHE <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #6941
-rw-r--r-- | cmd/zed/agents/zfs_diagnosis.c | 11 | ||||
-rw-r--r-- | cmd/zpool/zpool_main.c | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/cmd/zed/agents/zfs_diagnosis.c b/cmd/zed/agents/zfs_diagnosis.c index 6f1f4d017..bb8db6af5 100644 --- a/cmd/zed/agents/zfs_diagnosis.c +++ b/cmd/zed/agents/zfs_diagnosis.c @@ -167,14 +167,12 @@ zfs_case_unserialize(fmd_hdl_t *hdl, fmd_case_t *cp) static void zfs_mark_vdev(uint64_t pool_guid, nvlist_t *vd, er_timeval_t *loaded) { - uint64_t vdev_guid; + uint64_t vdev_guid = 0; uint_t c, children; nvlist_t **child; zfs_case_t *zcp; - int ret; - ret = nvlist_lookup_uint64(vd, ZPOOL_CONFIG_GUID, &vdev_guid); - assert(ret == 0); + (void) nvlist_lookup_uint64(vd, ZPOOL_CONFIG_GUID, &vdev_guid); /* * Mark any cases associated with this (pool, vdev) pair. @@ -253,7 +251,10 @@ zfs_mark_pool(zpool_handle_t *zhp, void *unused) } ret = nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &vd); - assert(ret == 0); + if (ret) { + zpool_close(zhp); + return (-1); + } zfs_mark_vdev(pool_guid, vd, &loaded); diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index a44167a38..2293e79df 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -2271,11 +2271,9 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts, int ret = 0; zpool_handle_t *zhp; char *name; - uint64_t state; uint64_t version; name = fnvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME); - state = fnvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE); version = fnvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION); if (!SPA_VERSION_IS_SUPPORTED(version)) { |