intel/skylake: Fix issues found by klockwork

src/soc/intel/skylake/acpi.c
  Function cbmem_find may return NULL, check before using its result.

src/soc/intel/skylake/flash_controller.c
  Remove dead code: spi_claim_bus is a no-op, always returning 0.

src/soc/intel/skylake/gpio.c
  Check for NULL before using pointers.

src/soc/intel/skylake/igd.c
  Don't copy 0-termination of signature string.

src/soc/intel/skylake/lpc.c
  Don't check unsigned >= 0.

src/soc/intel/skylake/systemagent.c
  Explicitly cast result to 64bit.

BRANCH=None
BUG=chrome-os-partner:48542
TEST=Built & booted Kunimitsu board.

Change-Id: I6cbf4f78382383d3c8c3b15f66c5898ab5bf183a
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: d98a8cdd3d095a6943c0e104cd4938639a62bd14
Original-Change-Id: Id2a31402618f4c9f6f53525ebcf6b71fd67428db
Original-Signed-off-by: Naresh G Solanki <Naresh.Solanki@intel.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/317522
Original-Commit-Ready: Naresh Solanki <naresh.solanki@intel.com>
Original-Tested-by: Naresh Solanki <naresh.solanki@intel.com>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/12991
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
Naresh G Solanki
2015-12-11 18:13:02 +05:30
committed by Patrick Georgi
parent bdab9f787c
commit a1b3547f0f
6 changed files with 18 additions and 12 deletions

View File

@ -261,6 +261,9 @@ static void gpio_handle_pad_mode(const struct pad_config *cfg)
bit = 0;
hostsw_own_reg = gpio_hostsw_reg(cfg->pad, &bit);
if (hostsw_own_reg == NULL)
return;
reg = read32(hostsw_own_reg);
reg &= ~(1U << bit);
@ -282,7 +285,8 @@ static void gpi_enable_smi(gpio_t pad)
uint32_t pad_mask;
comm = gpio_get_community(pad);
if (comm == NULL)
return;
regs = pcr_port_regs(comm->port_id);
gpi_status_reg = (void *)&regs[GPI_SMI_STS_OFFSET];
gpi_en_reg = (void *)&regs[GPI_SMI_EN_OFFSET];