diff options
author | Patrick Georgi <pgeorgi@chromium.org> | 2016-07-29 18:37:56 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2016-11-02 17:29:37 +0100 |
commit | 84164603188175abd2a3d8eeab1adc5efc33330f (patch) | |
tree | 7b1b10b31f2536614a61f4e0564f5ab148c807f8 | |
parent | 1f60007be8d6dc10805aa094682a7890df727663 (diff) |
intel/{skylake,apollolake}: 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.
Adapt Change-Id I7d1cdb6af4140f7dc322141c0c018d8418627434 to fix more
instances.
Change-Id: I001a9b484a68e018798a65c0fae11f8df7d9f564
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1357450, #1357449
Reviewed-on: https://review.coreboot.org/17054
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
-rw-r--r-- | src/soc/intel/apollolake/i2c_early.c | 2 | ||||
-rw-r--r-- | src/soc/intel/skylake/i2c.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/soc/intel/apollolake/i2c_early.c b/src/soc/intel/apollolake/i2c_early.c index 968e99394a..82883f847d 100644 --- a/src/soc/intel/apollolake/i2c_early.c +++ b/src/soc/intel/apollolake/i2c_early.c @@ -32,7 +32,7 @@ static int i2c_early_init_bus(unsigned bus) const struct lpss_i2c_speed_config *sptr; enum i2c_speed speed; pci_devfn_t dev; - unsigned devfn; + int devfn; uintptr_t base; uint32_t value; void *reg; diff --git a/src/soc/intel/skylake/i2c.c b/src/soc/intel/skylake/i2c.c index eebe665d94..d37c290079 100644 --- a/src/soc/intel/skylake/i2c.c +++ b/src/soc/intel/skylake/i2c.c @@ -24,7 +24,7 @@ uintptr_t lpss_i2c_base_address(unsigned bus) { - unsigned devfn; + int devfn; struct device *dev; struct resource *res; |