From e41db484c3f3762564ead0c85651e26156147cbc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 2 Jun 2021 10:35:23 +0200 Subject: [PATCH] pid1: shorten code a bit --- src/core/device.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/core/device.c b/src/core/device.c index b1b270808a..84898d7236 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -122,8 +122,8 @@ static int device_load(Unit *u) { return r; if (!u->description) { - /* Generate a description based on the path, to be used until the - device is initialized properly */ + /* Generate a description based on the path, to be used until the device is initialized + properly */ r = unit_name_to_path(u->id, &u->description); if (r < 0) log_unit_debug_errno(u, r, "Failed to unescape name: %m"); @@ -963,7 +963,6 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void * /* The device is found now, set the udev found bit */ device_update_found_by_sysfs(m, sysfs, DEVICE_FOUND_UDEV, DEVICE_FOUND_UDEV); - } else /* The device is nominally around, but not ready for us. Hence unset the udev bit, but leave * the rest around. */ @@ -1026,8 +1025,6 @@ static int validate_node(Manager *m, const char *node, sd_device **ret) { } void device_found_node(Manager *m, const char *node, DeviceFound found, DeviceFound mask) { - int r; - assert(m); assert(node); @@ -1052,8 +1049,7 @@ void device_found_node(Manager *m, const char *node, DeviceFound found, DeviceFo * under the name referenced in /proc/swaps or /proc/self/mountinfo. But first, let's validate if * everything is alright with the device node. */ - r = validate_node(m, node, &dev); - if (r <= 0) + if (validate_node(m, node, &dev) <= 0) return; /* Don't create a device unit for this if the device node is borked. */ (void) device_setup_unit(m, dev, node, false);