diff options
author | Joel Stanley <joel@jms.id.au> | 2015-07-21 12:53:12 +0930 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-08-13 15:52:33 +1000 |
commit | 6bc3d9531e4428d9b5944b1b2edb8f91b95811c3 (patch) | |
tree | 6769a9db329abf394d8405ba6725c8f5008c0f96 /include | |
parent | eff042167b9e10a94b6f036f9a54e23b2978269a (diff) | |
download | skiboot-6bc3d9531e4428d9b5944b1b2edb8f91b95811c3.zip skiboot-6bc3d9531e4428d9b5944b1b2edb8f91b95811c3.tar.gz skiboot-6bc3d9531e4428d9b5944b1b2edb8f91b95811c3.tar.bz2 |
fsp/chiptod: Fix initialised variable
If chiptod_adjust_topology returned true, rc would be uninitialised and the
message type passed to fsp_mkmsg would be undefined.
This also changes chiptod_adjust_topology to return true/false instead
of -1 and 0.
hw/fsp/fsp-chiptod.c:45:7: error: variable 'rc' is used uninitialized whenever
'if' condition is false [-Werror,-Wsometimes-uninitialized]
if (chiptod_adjust_topology(topo, action) < 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hw/fsp/fsp-chiptod.c:48:50: note: uninitialized use occurs here
resp = fsp_mkmsg(FSP_RSP_TOPO_ENABLE_DISABLE | rc, 0);
^~
hw/fsp/fsp-chiptod.c:45:3: note: remove the 'if' if its condition is always true
if (chiptod_adjust_topology(topo, action) < 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hw/fsp/fsp-chiptod.c:30:12: note: initialize the variable 'rc' to silence this
warning
uint8_t rc;
^
= '\0'
Signed-off-by: Joel Stanley <joel@jms.id.au>
foo
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/chiptod.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/chiptod.h b/include/chiptod.h index b220fd7..daf37b1 100644 --- a/include/chiptod.h +++ b/include/chiptod.h @@ -31,7 +31,7 @@ extern void chiptod_init(void); extern bool chiptod_wakeup_resync(void); extern int chiptod_recover_tb_errors(void); extern void chiptod_reset_tb(void); -extern int chiptod_adjust_topology(enum chiptod_topology topo, bool enable); +extern bool chiptod_adjust_topology(enum chiptod_topology topo, bool enable); extern bool chiptod_capp_timebase_sync(uint32_t chip_id); #endif /* __CHIPTOD_H */ |