diff options
author | Patrick Georgi <pgeorgi@chromium.org> | 2016-07-29 18:19:46 +0200 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-07-31 19:19:33 +0200 |
commit | 21ce6efe289ecc8eb6f047ceb3c3c25303e7272e (patch) | |
tree | bbc1b02fbb1e8d68b9888d9f764ac657f94f5d3d /src/southbridge | |
parent | e8c413318f6c4d4297b774ca129cd0a63cec4422 (diff) | |
download | coreboot-21ce6efe289ecc8eb6f047ceb3c3c25303e7272e.tar.xz |
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>
Diffstat (limited to 'src/southbridge')
-rw-r--r-- | src/southbridge/sis/sis966/sis966.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/southbridge/sis/sis966/sis966.c b/src/southbridge/sis/sis966/sis966.c index 308c604abb..6ac15db414 100644 --- a/src/southbridge/sis/sis966/sis966.c +++ b/src/southbridge/sis/sis966/sis966.c @@ -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; |