]> sourceware.org Git - lvm2.git/commitdiff
cleanup: check pv_count is not 0
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 21 Aug 2014 13:38:18 +0000 (15:38 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 26 Aug 2014 12:13:06 +0000 (14:13 +0200)
Since we already detect writemostly_ARG is non-zero
make it obvious pv_count will also be non-zero in this case.

tools/lvchange.c

index 42769c2917d1402f61f05d5b12dfe86a43da1975..0981f2ccf6810b73fd382e3dd1f23553e4b9e4f5 100644 (file)
@@ -740,9 +740,8 @@ static int lvchange_writemostly(struct logical_volume *lv)
        if (arg_count(cmd, writebehind_ARG))
                raid_seg->writebehind = arg_uint_value(cmd, writebehind_ARG, 0);
 
-       if (arg_count(cmd, writemostly_ARG)) {
+       if ((pv_count = arg_count(cmd, writemostly_ARG))) {
                /* writemostly can be specified more than once */
-               pv_count = arg_count(cmd, writemostly_ARG);
                pv_names = dm_pool_alloc(lv->vg->vgmem, sizeof(char *) * pv_count);
                if (!pv_names)
                        return_0;
This page took 0.038059 seconds and 5 git commands to generate.