diff --git a/src/bioscall/pcibios.c b/src/bioscall/pcibios.c index 4e3ec4eb26..27d7e7e1ba 100644 --- a/src/bioscall/pcibios.c +++ b/src/bioscall/pcibios.c @@ -50,7 +50,7 @@ pcibios( unsigned short func = (unsigned short) eax; int retval = -1; unsigned short devid, vendorid, devfn; - int devindex; + short devindex; /* Use short to get rid of gabage in upper half of 32-bit register */ unsigned char bus; struct pci_dev *dev; @@ -76,7 +76,8 @@ pcibios( *peax = 0; // busnum is an unsigned char; // devfn is an int, so we mask it off. - busdevfn = dev->bus->secondary | (dev->devfn & 0xff); + busdevfn = (dev->bus->secondary << 8) + | (dev->devfn & 0xff); printk_debug("0x%x: return 0x%x\n", func, busdevfn); *pebx = busdevfn; retval = 0;