From: Yu Watanabe Date: Fri, 7 Jul 2023 03:55:40 +0000 (+0900) Subject: udev-builtin-net_id: swap arguments for streq() and friends X-Git-Tag: v255-rc1~877^2~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a62da02ccefc60816f9b6ffb61a5b4ce83808cc;p=thirdparty%2Fsystemd.git udev-builtin-net_id: swap arguments for streq() and friends --- diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index 7aa7eea1486..2c4637d0333 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -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);