main - cleanup: simplify condition
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1042cd9a612e1f71fda15dac62948707acee326e Commit: 1042cd9a612e1f71fda15dac62948707acee326e Parent: eb3dcc72eb0e1f3922dafcc4d018db70aabc3bc9 Author: Zdenek Kabelac <[email protected]> AuthorDate: Sat Feb 27 21:18:48 2021 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Mar 2 22:57:35 2021 +0100
cleanup: simplify condition
--- lib/device/dev-cache.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
lib/device/dev-cache.c +4 -6
@@ -1563,9 +1563,6 @@ struct device *dev_cache_get_by_devt(struct cmd_context *cmd, dev_t dev, structif (filtered) *filtered =0 ; -if (d && (d->flags &DEV_REGULAR )) -return d; -if (!d) { sysfs_dir =dm_sysfs_dir ();if (sysfs_dir && *sysfs_dir) {
@@ -1587,10 +1584,10 @@ struct device *dev_cache_get_by_devt(struct cmd_context *cmd, dev_t dev, struct (int)MAJOR(dev), (int)MINOR(dev));dev_cache_scan (); d = (struct device *)btree_lookup (_cache.devices, (uint32_t ) dev); - } -if (!d) -return NULL ; +if (!d) +return NULL ; + }if (d->flags &DEV_REGULAR )return d;
@@ -1611,6 +1608,7 @@ struct device *dev_cache_get_by_devt(struct cmd_context *cmd, dev_t dev, structif (filtered) *filtered =1 ; +return NULL ; }