diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-11-10 17:14:04 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-11-10 17:14:04 +1100 |
commit | 8dfdef7aef29fee1e0e48e6dbdec68371ac59b1f (patch) | |
tree | 9690424131776e51c30e96ff2def02ba7cfebf70 | |
parent | 0e63e6849ec5fa50a108441382e963b31d1cbc58 (diff) | |
download | blackbird-skiboot-8dfdef7aef29fee1e0e48e6dbdec68371ac59b1f.tar.gz blackbird-skiboot-8dfdef7aef29fee1e0e48e6dbdec68371ac59b1f.zip |
llvm-scan-build: fix value stored to rc never read in hw/occ.c
hw/occ.c:278:2: warning: Value stored to 'rc' is never read
rc = xscom_read(chip->id, XSCOM_ADDR_P8_EX_SLAVE(core, EX_PM_PPMCR), &tmp);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hw/occ.c:309:2: warning: Value stored to 'rc' is never read
rc = xscom_read(chip->id, XSCOM_ADDR_P8_EX_SLAVE(core, EX_PM_PPMSR), &tmp);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hw/occ.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -276,6 +276,11 @@ static bool cpu_pstates_prepare_core(struct proc_chip *chip, struct cpu_thread * /* Set new pstate to core */ rc = xscom_read(chip->id, XSCOM_ADDR_P8_EX_SLAVE(core, EX_PM_PPMCR), &tmp); + if (rc) { + log_simple_error(&e_info(OPAL_RC_OCC_PSTATE_INIT), + "OCC: Failed to read from OCC in pstates init\n"); + return false; + } tmp = tmp & ~0xFFFF000000000000ULL; pstate = ((uint64_t) pstate_nom) & 0xFF; tmp = tmp | (pstate << 56) | (pstate << 48); @@ -307,6 +312,12 @@ static bool cpu_pstates_prepare_core(struct proc_chip *chip, struct cpu_thread * /* Just debug */ rc = xscom_read(chip->id, XSCOM_ADDR_P8_EX_SLAVE(core, EX_PM_PPMSR), &tmp); + if (rc) { + log_simple_error(&e_info(OPAL_RC_OCC_PSTATE_INIT), + "OCC: Failed to read back setting from OCC" + "in pstates init\n"); + return false; + } prlog(PR_DEBUG, "OCC: Chip %x Core %x PPMSR %016llx\n", chip->id, core, tmp); |