summaryrefslogtreecommitdiffstats
path: root/hdata
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2017-09-20 14:27:34 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-09-20 03:15:14 -0500
commit8599e8ad69052e5dfcc2625dab1211302fb45f9a (patch)
treeb7c247640da8c89eccf6bcf1b62d7446c572fab7 /hdata
parent9c1870022d131e18bbe2858ff90731e83a95c5d4 (diff)
downloadblackbird-skiboot-8599e8ad69052e5dfcc2625dab1211302fb45f9a.tar.gz
blackbird-skiboot-8599e8ad69052e5dfcc2625dab1211302fb45f9a.zip
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>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/spira.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hdata/spira.c b/hdata/spira.c
index 52537680..7be53b9b 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;
OpenPOWER on IntegriCloud