sis/sis966: don't store a 32bit value in a 16bit variable

That only makes deviceid == 0 (because shifting a 16bit value by 16
bits, well...)

Change-Id: Iddca1de20760f92f70fe2d05886b488e5b48313d
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1229558
Reviewed-on: https://review.coreboot.org/15960
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
Patrick Georgi 2016-07-29 18:19:46 +02:00 committed by Martin Roth
parent e8c413318f
commit 21ce6efe28
1 changed files with 3 additions and 3 deletions

View File

@ -71,9 +71,9 @@ void sis966_enable(device_t dev)
int i;
if(dev->device==0x0000) {
vendorid = pci_read_config32(dev, PCI_VENDOR_ID);
deviceid = (vendorid>>16) & 0xffff;
// vendorid &= 0xffff;
reg = pci_read_config32(dev, PCI_VENDOR_ID);
deviceid = (reg >> 16) & 0xffff;
vendorid = reg & 0xffff;
} else {
// vendorid = dev->vendor;
deviceid = dev->device;