struct pci_dev *d = pci_alloc_dev(a);
unsigned int dfn, vend, cnt, known;
- cnt = sscanf(buf,
-#ifdef HAVE_LONG_ADDRESS
- "%x %x %x %llx %llx %llx %llx %llx %llx %llx %llx %llx %llx %llx %llx %llx %llx",
-#else
- "%x %x %x %lx %lx %lx %lx %lx %lx %lx %lx %lx %lx %lx %lx %lx %lx",
-#endif
+#define F " " PCIADDR_T_FMT
+ cnt = sscanf(buf, "%x %x %x" F F F F F F F F F F F F F F,
&dfn,
&vend,
&d->irq,
&d->size[4],
&d->size[5],
&d->rom_size);
+#undef F
if (cnt != 9 && cnt != 10 && cnt != 17)
a->error("proc: parse error (read only %d items)", cnt);
d->bus = dfn >> 8U;
d->func = PCI_FUNC(dfn & 0xff);
d->vendor_id = vend >> 16U;
d->device_id = vend & 0xffff;
- d->hdrtype = pci_read_byte(d, PCI_HEADER_TYPE);
+ d->hdrtype = pci_read_byte(d, PCI_HEADER_TYPE) & 0x7f;
known = PCI_FILL_IDENT;
if (!a->buscentric)
{