diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-09-20 14:27:34 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-09-20 03:15:14 -0500 |
commit | 8599e8ad69052e5dfcc2625dab1211302fb45f9a (patch) | |
tree | b7c247640da8c89eccf6bcf1b62d7446c572fab7 | |
parent | 9c1870022d131e18bbe2858ff90731e83a95c5d4 (diff) | |
download | skiboot-8599e8ad69052e5dfcc2625dab1211302fb45f9a.zip skiboot-8599e8ad69052e5dfcc2625dab1211302fb45f9a.tar.gz skiboot-8599e8ad69052e5dfcc2625dab1211302fb45f9a.tar.bz2 |
hdat: logically dead code, assert instead
Since we already assert that base != NULL, the if()
condition on hdif can never be NULL. Instead, we should
just assert (if even that) if it is.
Found by Coverity
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hdata/spira.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hdata/spira.c b/hdata/spira.c index 5253768..7be53b9 100644 --- a/hdata/spira.c +++ b/hdata/spira.c @@ -313,8 +313,7 @@ static const void *xscom_to_pcrd(struct dt_node *xscom, int idata_index) assert(i < be16_to_cpu(t->act_cnt)); hdif = base + i * be32_to_cpu(t->alloc_len); - if (!hdif) - return NULL; + assert(hdif); if (idata_index == GET_HDIF_HDR) return hdif; |