summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2023-04-26 16:32:23 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2023-05-06 20:38:57 +0200
commitf038fc3b177c43b9bb0929f5dcc834e24574df03 (patch)
treed32e7636e1500d00d53e0c040edc9e5ed6e3da8e /lib
parentc451d7925d91c6fec56b1537e341a5bbc94fb545 (diff)
downloadlvm2-f038fc3b177c43b9bb0929f5dcc834e24574df03.tar.gz
cov: remove unused but set variables
Diffstat (limited to 'lib')
-rw-r--r--lib/device/dev-cache.c3
-rw-r--r--lib/device/dev-mpath.c4
-rw-r--r--lib/metadata/integrity_manip.c4
-rw-r--r--lib/metadata/lv_manip.c3
4 files changed, 6 insertions, 8 deletions
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;
}