From 0ddb15964a65bd1a1d56aa76d3cbbf29d4bc1ba4 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 22 Dec 2010 15:44:09 +0000 Subject: [PATCH] Remove check for existance of vg pointer Checking for vg being != NULL in this place is not needed. Pointer vg is already dereferced in this function above this code line. Also this internal function _read_pv is always called with valid 'vg' pointer. --- lib/format_text/import_vsn1.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c index e5e83d46a..bbb80008c 100644 --- a/lib/format_text/import_vsn1.c +++ b/lib/format_text/import_vsn1.c @@ -257,14 +257,10 @@ static int _read_pv(struct format_instance *fid, struct dm_pool *mem, log_verbose("Fixing up missing size (%s) " "for PV %s", display_size(fid->fmt->cmd, pv->size), pv_dev_name(pv)); - if (vg) { - size = pv->pe_count * (uint64_t) vg->extent_size + - pv->pe_start; - if (size > pv->size) - log_warn("WARNING: Physical Volume %s is too " - "large for underlying device", - pv_dev_name(pv)); - } + size = pv->pe_count * (uint64_t) vg->extent_size + pv->pe_start; + if (size > pv->size) + log_warn("WARNING: Physical Volume %s is too large " + "for underlying device", pv_dev_name(pv)); } if (!alloc_pv_segment_whole_pv(mem, pv)) -- 2.43.5