summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin-path_id.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-08-03 16:49:05 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-08-07 09:01:41 +0200
commitd340bdd1bd435e9f5524f4246feaf38511b2ff45 (patch)
treec236d8a6eb534360f4077cc3e533a4046004aa36 /src/udev/udev-builtin-path_id.c
parentd3d2e3abda33ef0fa88628f749c04dc77e878275 (diff)
downloadsystemd-d340bdd1bd435e9f5524f4246feaf38511b2ff45.tar.gz
udev/builtins: make skip_subsystem() and skip_virtio() alike
The two functions do not implement identical logic, so they shouldn't have identical structure, but let's make them both a bit simpler and more alike.
Diffstat (limited to 'src/udev/udev-builtin-path_id.c')
-rw-r--r--src/udev/udev-builtin-path_id.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c
index effc36f36a..083ce67803 100644
--- a/src/udev/udev-builtin-path_id.c
+++ b/src/udev/udev-builtin-path_id.c
@@ -80,22 +80,19 @@ static int format_lun_number(sd_device *dev, char **path) {
}
static sd_device *skip_subsystem(sd_device *dev, const char *subsys) {
- sd_device *parent;
-
assert(dev);
assert(subsys);
- for (parent = dev; ; ) {
+ for (;;) {
const char *subsystem;
- if (sd_device_get_subsystem(parent, &subsystem) < 0)
+ if (sd_device_get_subsystem(dev, &subsystem) < 0)
break;
if (!streq(subsystem, subsys))
break;
- dev = parent;
- if (sd_device_get_parent(dev, &parent) < 0)
+ if (sd_device_get_parent(dev, &dev) < 0)
break;
}