]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: don't compare pointers with numeric zero
authorLennart Poettering <lennart@poettering.net>
Wed, 10 Feb 2021 21:18:52 +0000 (22:18 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 18 Feb 2021 17:20:09 +0000 (18:20 +0100)
Our coding style says no to this.

src/libsystemd/sd-device/device-private.c

index e37575d3b936d795032ada28d0f3258ae215aae7..c39ac3f3b959619333477b6622aae16060df2802 100644 (file)
@@ -355,7 +355,12 @@ static int device_amend(sd_device *device, const char *key, const char *value) {
         return 0;
 }
 
-static int device_append(sd_device *device, char *key, const char **_major, const char **_minor) {
+static int device_append(
+                sd_device *device,
+                char *key,
+                const char **_major,
+                const char **_minor) {
+
         const char *major = NULL, *minor = NULL;
         char *value;
         int r;
@@ -384,10 +389,10 @@ static int device_append(sd_device *device, char *key, const char **_major, cons
                         return r;
         }
 
-        if (major != 0)
+        if (major)
                 *_major = major;
 
-        if (minor != 0)
+        if (minor)
                 *_minor = minor;
 
         return 0;