From f038fc3b177c43b9bb0929f5dcc834e24574df03 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 26 Apr 2023 16:32:23 +0200 Subject: cov: remove unused but set variables --- lib/device/dev-cache.c | 3 +-- lib/device/dev-mpath.c | 4 ++-- lib/metadata/integrity_manip.c | 4 ++-- lib/metadata/lv_manip.c | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index 85f9b499a..3d13e16bc 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -2231,7 +2231,6 @@ try_partition: int setup_devname_in_dev_cache(struct cmd_context *cmd, const char *devname) { struct stat buf; - struct device *dev; if (stat(devname, &buf) < 0) { log_error("Cannot access device %s.", devname); @@ -2246,7 +2245,7 @@ int setup_devname_in_dev_cache(struct cmd_context *cmd, const char *devname) if (!_insert_dev(devname, buf.st_rdev)) return_0; - if (!(dev = (struct device *) dm_hash_lookup(_cache.names, devname))) + if (!dm_hash_lookup(_cache.names, devname)) return_0; return 1; diff --git a/lib/device/dev-mpath.c b/lib/device/dev-mpath.c index fb45d1858..5433b64e1 100644 --- a/lib/device/dev-mpath.c +++ b/lib/device/dev-mpath.c @@ -50,7 +50,7 @@ static void _read_blacklist_file(const char *path) FILE *fp; char line[MAX_WWID_LINE]; char wwid[MAX_WWID_LINE]; - char *word, *p; + char *word; int section_black = 0; int section_exceptions = 0; int found_quote; @@ -100,7 +100,7 @@ static void _read_blacklist_file(const char *path) * section, and skips those (should the entire mp * config filtering be disabled if non-wwids are seen? */ - if (!(p = strstr(word, "wwid"))) + if (!strstr(word, "wwid")) continue; i += 4; /* skip "wwid" */ diff --git a/lib/metadata/integrity_manip.c b/lib/metadata/integrity_manip.c index 0c1c29436..d71fbaeb6 100644 --- a/lib/metadata/integrity_manip.c +++ b/lib/metadata/integrity_manip.c @@ -484,7 +484,7 @@ int lv_add_integrity_to_raid(struct logical_volume *lv, struct integrity_setting struct logical_volume *imeta_lvs[DEFAULT_RAID_MAX_IMAGES]; struct cmd_context *cmd = lv->vg->cmd; struct volume_group *vg = lv->vg; - struct logical_volume *lv_image, *lv_imeta, *lv_iorig; + struct logical_volume *lv_image, *lv_imeta; struct lv_segment *seg_top, *seg_image; struct pv_list *pvl; const struct segment_type *segtype; @@ -682,7 +682,7 @@ int lv_add_integrity_to_raid(struct logical_volume *lv, struct integrity_setting * but gets a new integrity segment, in place of the segments * that were moved to lv_iorig. */ - if (!(lv_iorig = insert_layer_for_lv(cmd, lv_image, INTEGRITY, "_iorig"))) + if (!insert_layer_for_lv(cmd, lv_image, INTEGRITY, "_iorig")) goto_bad; lv_image->status |= INTEGRITY; diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index b8e6ce053..298d307f3 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -4370,13 +4370,12 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah, for (s = 0; s < seg->area_count; s++) { struct logical_volume *lv_image; struct logical_volume *lv_iorig; - struct logical_volume *lv_imeta; struct lv_segment *seg_image; lv_image = seg_lv(seg, s); seg_image = first_seg(lv_image); - if (!(lv_imeta = seg_image->integrity_meta_dev)) { + if (!seg_image->integrity_meta_dev) { log_error("1"); return 0; } -- cgit v1.2.1