diff options
author | Tom Gundersen <teg@jklm.no> | 2015-06-02 16:52:07 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-06-02 18:12:47 +0200 |
commit | 3b64e4d4f40baac56148c7d333d6a0053358ec7a (patch) | |
tree | 770d251059fd20ee9a4ed7510f639a716367c7b0 /src/udev/udev-builtin-net_id.c | |
parent | 7283a80d10217b929acf58899f016ca06dacdc53 (diff) |
udev: add some asserts
Mostly for documentation purposes.
Diffstat (limited to 'src/udev/udev-builtin-net_id.c')
-rw-r--r-- | src/udev/udev-builtin-net_id.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index 448920507a..6e7e1271fb 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -276,6 +276,9 @@ out: static int names_pci(struct udev_device *dev, struct netnames *names) { struct udev_device *parent; + assert(dev); + assert(names); + parent = udev_device_get_parent(dev); if (!parent) return -ENOENT; @@ -302,6 +305,9 @@ static int names_usb(struct udev_device *dev, struct netnames *names) { size_t l; char *s; + assert(dev); + assert(names); + usbdev = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_interface"); if (!usbdev) return -ENOENT; @@ -350,6 +356,9 @@ static int names_bcma(struct udev_device *dev, struct netnames *names) { struct udev_device *bcmadev; unsigned int core; + assert(dev); + assert(names); + bcmadev = udev_device_get_parent_with_subsystem_devtype(dev, "bcma", NULL); if (!bcmadev) return -ENOENT; @@ -371,6 +380,9 @@ static int names_ccw(struct udev_device *dev, struct netnames *names) { size_t bus_id_len; int rc; + assert(dev); + assert(names); + /* Retrieve the associated CCW device */ cdev = udev_device_get_parent(dev); if (!cdev) |