intel/skylake: Enable signalling of error condition

Testing for "devfn < 0" on an unsigned doesn't work, and i2c_bus_to_devfn
returns an int (with -1 for "error"), so use int for devfn.

Change-Id: I7d1cdb6af4140f7dc322141c0c018d8418627434
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1357450, #1357449
Reviewed-on: https://review.coreboot.org/15964
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Patrick Georgi 2016-07-29 18:37:56 +02:00 committed by Martin Roth
parent bce1807d9c
commit 90ed31beac
1 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@
uintptr_t lpss_i2c_base_address(unsigned bus) uintptr_t lpss_i2c_base_address(unsigned bus)
{ {
unsigned devfn; int devfn;
pci_devfn_t dev; pci_devfn_t dev;
/* Find device+function for this controller */ /* Find device+function for this controller */
@ -49,7 +49,7 @@ static void i2c_early_init_bus(unsigned bus)
const struct lpss_i2c_speed_config *sptr; const struct lpss_i2c_speed_config *sptr;
enum i2c_speed speed; enum i2c_speed speed;
pci_devfn_t dev; pci_devfn_t dev;
unsigned devfn; int devfn;
uintptr_t base; uintptr_t base;
uint32_t value; uint32_t value;
void *reg; void *reg;