From: Oleksandr Tymoshenko Date: Sun, 19 Aug 2018 19:48:07 +0000 (-0700) Subject: Fix device_class calculatoin for non-root FreeBSD users X-Git-Tag: v3.6.3~34 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0f3898a44ad32bec37543a03ed8021f5c880e3c1;p=pciutils.git Fix device_class calculatoin for non-root FreeBSD users libpci uses PCIOCGETCONF for non-privileged access to /dev/pci and calculates device_class value based on pc_class/pc_subclass fields expecting the former to be higher 8 bits of the target value. 0f3d0ca73ecedaba180bf4607bb57fb8abe6d405 errorneously swapped order of class/subclass during calculations. Signed-off-by: Oleksandr Tymoshenko --- diff --git a/lib/fbsd-device.c b/lib/fbsd-device.c index 8d1ec11..6bb5fdd 100644 --- a/lib/fbsd-device.c +++ b/lib/fbsd-device.c @@ -207,7 +207,7 @@ fbsd_fill_info(struct pci_dev *d, int flags) } if (flags & PCI_FILL_CLASS) { - d->device_class = match.pc_class | (match.pc_subclass << 8); + d->device_class = (match.pc_class << 8) | match.pc_subclass; } if (flags & (PCI_FILL_BASES | PCI_FILL_SIZES)) {