diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index 46470a5fd..e681ed8e6 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -67,7 +67,6 @@ static DM_LIST_INIT(_vginfos); static DM_LIST_INIT(_found_duplicate_devs); static DM_LIST_INIT(_unused_duplicate_devs); static int _scanning_in_progress = 0; -static int _has_scanned = 0; static int _vgs_locked = 0; static int _found_duplicate_pvs = 0; /* If we never see a duplicate PV we can skip checking for them later. */ @@ -1808,8 +1807,6 @@ void lvmcache_destroy(struct cmd_context *cmd, int retain_orphans, int reset) { log_debug_cache("Dropping VG info"); - _has_scanned = 0; - if (_vgid_hash) { dm_hash_destroy(_vgid_hash); _vgid_hash = NULL; diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index 9b141fe93..fa9203127 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -666,10 +666,9 @@ struct dm_list *dev_cache_get_dev_list_for_lvid(const char *lvid) void dev_cache_failed_path(struct device *dev, const char *path) { - struct device *dev_by_path; struct dm_str_list *strl; - if ((dev_by_path = (struct device *) dm_hash_lookup(_cache.names, path))) + if (dm_hash_lookup(_cache.names, path)) dm_hash_remove(_cache.names, path); dm_list_iterate_items(strl, &dev->aliases) { diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 3b28bf583..57e184268 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -1647,15 +1647,13 @@ struct generic_logical_volume *find_historical_glv(const struct volume_group *vg int lv_name_is_used_in_vg(const struct volume_group *vg, const char *name, int *historical) { - struct generic_logical_volume *historical_lv; - struct logical_volume *lv; int found = 0; - if ((lv = find_lv(vg, name))) { + if (find_lv(vg, name)) { found = 1; if (historical) *historical = 0; - } else if ((historical_lv = find_historical_glv(vg, name, 0, NULL))) { + } else if (find_historical_glv(vg, name, 0, NULL)) { found = 1; if (historical) *historical = 1; diff --git a/libdm/dm-tools/dmfilemapd.c b/libdm/dm-tools/dmfilemapd.c index 0b17c2bfa..856df3df2 100644 --- a/libdm/dm-tools/dmfilemapd.c +++ b/libdm/dm-tools/dmfilemapd.c @@ -628,10 +628,10 @@ check_unlinked: static int _daemonise(struct filemap_monitor *fm) { - pid_t pid = 0, sid; + pid_t pid = 0; int fd; - if (!(sid = setsid())) { + if (!setsid()) { _early_log("setsid failed."); return 0; } diff --git a/tools/pvscan.c b/tools/pvscan.c index d110a6bd3..e3cd41045 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c @@ -452,7 +452,6 @@ static int _online_pvscan_one(struct cmd_context *cmd, struct device *dev, int disable_remove, const char **pvid_without_metadata) { - struct label *label; struct lvmcache_info *info; struct _pvscan_baton baton; const struct format_type *fmt; @@ -474,7 +473,7 @@ static int _online_pvscan_one(struct cmd_context *cmd, struct device *dev, return 1; } - if (!(label = lvmcache_get_label(info))) { + if (!lvmcache_get_label(info)) { log_debug("No PV label found for %s.", dev_name(dev)); if (!disable_remove) _online_pvid_file_remove_devno((int)MAJOR(dev->dev), (int)MINOR(dev->dev)); diff --git a/tools/vgchange.c b/tools/vgchange.c index 13b72cc8a..e8e302ce4 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -607,7 +607,7 @@ static int _vgchange_single(struct cmd_context *cmd, const char *vg_name, { int ret = ECMD_PROCESSED; unsigned i; - activation_change_t activate = CHANGE_AN; + activation_change_t activate; static const struct { int arg;