]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-builtin-net_id: swap arguments for streq() and friends
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 7 Jul 2023 03:55:40 +0000 (12:55 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 29 Jul 2023 13:14:23 +0000 (22:14 +0900)
src/udev/udev-builtin-net_id.c

index 7aa7eea14869773dcac1e971d7d3bc43250b2a69..2c4637d03330a6d3906fdc3fdae4ee2595f66b24 100644 (file)
@@ -522,7 +522,7 @@ static int names_vio(sd_device *dev, NetNames *names) {
         r = sd_device_get_subsystem(parent, &subsystem);
         if (r < 0)
                 return log_device_debug_errno(parent, r, "sd_device_get_subsystem() failed: %m");
-        if (!streq("vio", subsystem))
+        if (!streq(subsystem, "vio"))
                 return -ENOENT;
         log_device_debug(dev, "Parent device is in the vio subsystem.");
 
@@ -567,7 +567,7 @@ static int names_platform(sd_device *dev, NetNames *names, bool test) {
         if (r < 0)
                 return log_device_debug_errno(parent, r, "sd_device_get_subsystem() failed: %m");
 
-        if (!streq("platform", subsystem))
+        if (!streq(subsystem, "platform"))
                  return -ENOENT;
         log_device_debug(dev, "Parent device is in the platform subsystem.");
 
@@ -725,7 +725,7 @@ static int names_pci(sd_device *dev, const LinkInfo *info, NetNames *names) {
 
         /* check if our direct parent is a PCI device with no other bus in-between */
         if (sd_device_get_subsystem(parent, &subsystem) >= 0 &&
-            streq("pci", subsystem)) {
+            streq(subsystem, "pci")) {
                 names->type = NET_PCI;
                 names->pcidev = parent;
         } else {
@@ -1012,7 +1012,7 @@ static int names_xen(sd_device *dev, NetNames *names) {
         r = sd_device_get_subsystem(parent, &subsystem);
         if (r < 0)
                 return r;
-        if (!streq("xen", subsystem))
+        if (!streq(subsystem, "xen"))
                 return -ENOENT;
 
         /* Use the vif-n name to extract "n" */
@@ -1142,9 +1142,9 @@ static int builtin_net_id(UdevEvent *event, int argc, char *argv[], bool test) {
                 return 0;
         }
 
-        if (streq_ptr("wlan", info.devtype))
+        if (streq_ptr(info.devtype, "wlan"))
                 prefix = "wl";
-        else if (streq_ptr("wwan", info.devtype))
+        else if (streq_ptr(info.devtype, "wwan"))
                 prefix = "ww";
 
         udev_builtin_add_property(dev, test, "ID_NET_NAMING_SCHEME", naming_scheme()->name);