[5/8] opal_sync_host_reboot: clarify when we return OPAL_BUSY_EVENT

Message ID 20181129042833.27376-6-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.
Basically to shut up static analysis of using a boolean in a non-boolean
context (bitwise).

Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
---
 core/opal.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Patch

diff --git a/core/opal.c b/core/opal.c
index ba30c309ca58..46035e836087 100644
--- a/core/opal.c
+++ b/core/opal.c
@@ -704,14 +704,12 @@  void opal_del_host_sync_notifier(bool (*notify)(void *data))
 static int64_t opal_sync_host_reboot(void)
 {
 	struct opal_sync_entry *ent, *nxt;
-	bool ret = true;
+	int ret = OPAL_SUCCESS;
 
 	list_for_each_safe(&opal_syncers, ent, nxt, link)
-		ret &= ent->notify(ent->data);
+		if (! ent->notify(ent->data))
+			ret = OPAL_BUSY_EVENT;
 
-	if (ret)
-		return OPAL_SUCCESS;
-	else
-		return OPAL_BUSY_EVENT;
+	return ret;
 }
 opal_call(OPAL_SYNC_HOST_REBOOT, opal_sync_host_reboot, 0);