]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device-enumerator: shorten code a bit
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 20 Feb 2021 19:33:01 +0000 (04:33 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 20 Feb 2021 19:40:23 +0000 (04:40 +0900)
src/libsystemd/sd-device/device-enumerator.c

index e3c0af3429516679c84641b4ef215d91b8197efe..c98b029af23c84c26373e8fed865aa9d63afae71 100644 (file)
@@ -285,13 +285,11 @@ int device_enumerator_add_device(sd_device_enumerator *enumerator, sd_device *de
 
 static bool match_sysattr_value(sd_device *device, const char *sysattr, const char *match_value) {
         const char *value;
-        int r;
 
         assert(device);
         assert(sysattr);
 
-        r = sd_device_get_sysattr_value(device, sysattr, &value);
-        if (r < 0)
+        if (sd_device_get_sysattr_value(device, sysattr, &value) < 0)
                 return false;
 
         if (!match_value)