1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

lvmdiskscan: use while loop

Use more readable while() loop like in other similar instancies.
This commit is contained in:
Zdenek Kabelac 2024-11-04 17:41:02 +01:00
parent e42ceccc6d
commit 03782806eb

View File

@ -40,7 +40,7 @@ static int _get_max_dev_name_len(struct cmd_context *cmd, struct dev_filter *fil
} }
/* Do scan */ /* Do scan */
for (dev = dev_iter_get(cmd, iter); dev; dev = dev_iter_get(cmd, iter)) { while ((dev = dev_iter_get(cmd, iter))) {
len = strlen(dev_name(dev)); len = strlen(dev_name(dev));
if (len > maxlen) if (len > maxlen)
maxlen = len; maxlen = len;
@ -107,7 +107,7 @@ int lvmdiskscan(struct cmd_context *cmd, int argc __attribute__((unused)),
return ECMD_FAILED; return ECMD_FAILED;
} }
for (dev = dev_iter_get(cmd, iter); dev; dev = dev_iter_get(cmd, iter)) { while ((dev = dev_iter_get(cmd, iter))) {
if (lvmcache_has_dev_info(dev)) { if (lvmcache_has_dev_info(dev)) {
if (!dev_get_size(dev, &size)) { if (!dev_get_size(dev, &size)) {
log_error("Couldn't get size of \"%s\"", log_error("Couldn't get size of \"%s\"",