From 21ce6efe289ecc8eb6f047ceb3c3c25303e7272e Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 29 Jul 2016 18:19:46 +0200 Subject: 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 Found-by: Coverity Scan #1229558 Reviewed-on: https://review.coreboot.org/15960 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Duncan Laurie --- src/southbridge/sis/sis966/sis966.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/southbridge/sis') 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; -- cgit v1.2.3