diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-09-28 11:12:43 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-08-01 14:34:12 +0200 |
commit | a1008b2dabb5802f9083bed10f021d7e708b154a (patch) | |
tree | 419282b9450e06e5aa2b64c7b5d1ef77ba7f41f5 /src/udev/udev-builtin-net_id.c | |
parent | udev-builtin-net_id: introduce device_is_stacked() helper function (diff) | |
download | systemd-a1008b2dabb5802f9083bed10f021d7e708b154a.tar.xz systemd-a1008b2dabb5802f9083bed10f021d7e708b154a.zip |
udev-builtin-net_id: various coding style cleanups
Diffstat (limited to '')
-rw-r--r-- | src/udev/udev-builtin-net_id.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index b8b8bfae36..4936ba518a 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -299,6 +299,8 @@ static int is_pci_multifunction(sd_device *dev) { size_t len; int r; + assert(dev); + r = sd_device_get_syspath(dev, &syspath); if (r < 0) return r; @@ -319,17 +321,16 @@ static int is_pci_multifunction(sd_device *dev) { } static bool is_pci_ari_enabled(sd_device *dev) { - const char *a; - - if (sd_device_get_sysattr_value(dev, "ari_enabled", &a) < 0) - return false; + assert(dev); - return streq(a, "1"); + return device_get_sysattr_bool(dev, "ari_enabled") > 0; } static bool is_pci_bridge(sd_device *dev) { const char *v, *p; + assert(dev); + if (sd_device_get_sysattr_value(dev, "modalias", &v) < 0) return false; |