[7/8] hdata/iohub.c: remove condition that was always true

Message ID 20181129042833.27376-8-stewart@linux.ibm.com
State Accepted
Headers show
Series
  • Random static analysis fixes
Related show

Checks

Context Check Description
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Stewart Smith Nov. 29, 2018, 4:28 a.m.
Caught by static analysis. The previous if() condition was ensuring lxr
was not null, so we don't need this additional check.

Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
---
 hdata/iohub.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch

diff --git a/hdata/iohub.c b/hdata/iohub.c
index f37f5abf31c8..e16fb0b4e3fd 100644
--- a/hdata/iohub.c
+++ b/hdata/iohub.c
@@ -82,8 +82,7 @@  static bool io_get_lx_info(const void *kwvpd, unsigned int kwvpd_sz,
 		return false;
 	}
 
-	if (lxr)
-		memcpy(lxrbuf, lxr, sizeof(uint32_t)*2);
+	memcpy(lxrbuf, lxr, sizeof(uint32_t)*2);
 
 	prlog(PR_DEBUG, "CEC:     LXRn=%d LXR=%08x%08x\n", lx_idx, lxrbuf[0], lxrbuf[1]);
 	prlog(PR_DEBUG, "CEC:     LX Info added to %llx\n", (long long)hn);