X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Ffbsd-device.c;h=2ea5e84402e690ddbbacb2687867792104bad1c3;hb=06f9ecf36e529695feea35038e15233dffe37bb7;hp=396ff1d66e77516275b1fc8da96efef7dd900688;hpb=ae693fcab9b636bf0e521f38060398417c3cf3d9;p=pciutils.git diff --git a/lib/fbsd-device.c b/lib/fbsd-device.c index 396ff1d..2ea5e84 100644 --- a/lib/fbsd-device.c +++ b/lib/fbsd-device.c @@ -5,7 +5,9 @@ * Updated in 2003 by Samy Al Bahra * Updated in 2017 by Imre Vadász * - * Can be freely distributed and used under the terms of the GNU GPL. + * Can be freely distributed and used under the terms of the GNU GPL v2+. + * + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -160,7 +162,7 @@ fbsd_scan(struct pci_access *a) } static void -fbsd_fill_info(struct pci_dev *d, int flags) +fbsd_fill_info(struct pci_dev *d, unsigned int flags) { struct pci_conf_io conf; struct pci_bar_io bar; @@ -195,9 +197,9 @@ fbsd_fill_info(struct pci_dev *d, int flags) if (ioctl(d->access->fd, PCIOCGETCONF, &conf) < 0) { - if (errno == ENODEV) - return 0; - d->access->error("fbsd_fill_info: ioctl(PCIOCGETCONF) failed: %s", strerror(errno)); + if (errno != ENODEV) + d->access->error("fbsd_fill_info: ioctl(PCIOCGETCONF) failed: %s", strerror(errno)); + return; } if (want_fill(d, flags, PCI_FILL_IDENT)) @@ -207,7 +209,7 @@ fbsd_fill_info(struct pci_dev *d, int flags) } if (want_fill(d, flags, PCI_FILL_CLASS)) d->device_class = (match.pc_class << 8) | match.pc_subclass; - if (want_fill(d, flags PCI_FILL_BASES | PCI_FILL_SIZES)) + if (want_fill(d, flags, PCI_FILL_BASES | PCI_FILL_SIZES)) { d->rom_base_addr = 0; d->rom_size = 0; @@ -224,7 +226,7 @@ fbsd_fill_info(struct pci_dev *d, int flags) if (ioctl(d->access->fd, PCIOCGETBAR, &bar) < 0) { if (errno == ENODEV) - return 0; + return; if (errno == EINVAL) { d->base_addr[i] = 0;