summaryrefslogtreecommitdiffstats
path: root/liblvm/lvm_pv.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-02-08 11:41:18 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2012-02-08 11:41:18 +0000
commiteae8784ae2440fb8a151259acc0a7cfc8984317b (patch)
treef07d5f26ea6d7cd481441f91c8341390d2a497ab /liblvm/lvm_pv.c
parentd75c5f06f0d08868ebc6de7d04bfe81a89da0d67 (diff)
downloadlvm2-eae8784ae2440fb8a151259acc0a7cfc8984317b.tar.gz
lvm2-eae8784ae2440fb8a151259acc0a7cfc8984317b.tar.xz
lvm2-eae8784ae2440fb8a151259acc0a7cfc8984317b.zip
Remove duplicate test
Tested condition has been already evaluated before For strlen() code has already excluded <ID_LEN. For repairing, already tested (!argc && !repairing) before.
Diffstat (limited to 'liblvm/lvm_pv.c')
-rw-r--r--liblvm/lvm_pv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/liblvm/lvm_pv.c b/liblvm/lvm_pv.c
index 4fe2d3ed..90edaed5 100644
--- a/liblvm/lvm_pv.c
+++ b/liblvm/lvm_pv.c
@@ -107,12 +107,12 @@ pv_t lvm_pv_from_uuid(vg_t vg, const char *uuid)
log_errno (EINVAL, "Invalid UUID string length");
return NULL;
}
- if (strlen(uuid) >= ID_LEN) {
- if (!id_read_format(&id, uuid)) {
- log_errno(EINVAL, "Invalid UUID format");
- return NULL;
- }
+
+ if (!id_read_format(&id, uuid)) {
+ log_errno(EINVAL, "Invalid UUID format.");
+ return NULL;
}
+
dm_list_iterate_items(pvl, &vg->pvs) {
if (id_equal(&id, &pvl->pv->id))
return pvl->pv;