From: Matthew Wilcox Date: Mon, 29 Jun 2009 11:07:41 +0000 (-0600) Subject: sysfs: Avoid warnings when the slot address is missing. X-Git-Tag: v3.1.3~13 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=534fbba975ad68865ebcafa1636233ce43335c9e;p=pciutils.git sysfs: Avoid warnings when the slot address is missing. --- diff --git a/lib/sysfs.c b/lib/sysfs.c index 2419b41..4c2c846 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -221,11 +221,13 @@ sysfs_fill_slots(struct pci_access *a) if (n < 0 || n >= OBJNAMELEN) a->error("File name too long"); file = fopen(namebuf, "r"); + /* + * Old versions of Linux had a fakephp which didn't have an 'address' + * file. There's no useful information to be gleaned from these + * devices, pretend they're not there. + */ if (!file) - { - a->warning("sysfs_fill_slots: Cannot open %s: %s", namebuf, strerror(errno)); - continue; - } + continue; if (!fgets(buf, sizeof(buf), file) || sscanf(buf, "%x:%x:%x", &dom, &bus, &dev) < 3) a->warning("sysfs_fill_slots: Couldn't parse entry address %s", buf);