From: Yu Watanabe Date: Sun, 17 Apr 2022 04:11:08 +0000 (+0900) Subject: sd-device: reduce indentation X-Git-Tag: v251-rc2~108^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5a75f2027e53bdaf4deb7087fac73f8be6bf4f4;p=thirdparty%2Fsystemd.git sd-device: reduce indentation --- diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c index 90dcd3a857f..9bf39ecfab2 100644 --- a/src/libsystemd/sd-device/device-private.c +++ b/src/libsystemd/sd-device/device-private.c @@ -774,19 +774,17 @@ int device_rename(sd_device *device, const char *name) { return r; r = sd_device_get_property_value(device, "INTERFACE", &interface); - if (r >= 0) { - /* like DEVPATH_OLD, INTERFACE_OLD is not saved to the db, but only stays around for the current event */ - r = device_add_property_internal(device, "INTERFACE_OLD", interface); - if (r < 0) - return r; + if (r == -ENOENT) + return 0; + if (r < 0) + return r; - r = device_add_property_internal(device, "INTERFACE", name); - if (r < 0) - return r; - } else if (r != -ENOENT) + /* like DEVPATH_OLD, INTERFACE_OLD is not saved to the db, but only stays around for the current event */ + r = device_add_property_internal(device, "INTERFACE_OLD", interface); + if (r < 0) return r; - return 0; + return device_add_property_internal(device, "INTERFACE", name); } int device_shallow_clone(sd_device *old_device, sd_device **new_device) {