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

Stewart Smith stewart at linux.ibm.com
Thu Nov 29 15:28:30 AEDT 2018


Basically to shut up static analysis of using a boolean in a non-boolean
context (bitwise).

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

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);
-- 
2.19.2



More information about the Skiboot mailing list