[Skiboot] [PATCH 3/6] SURV: Fix unused result warnings in surveillance code

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Wed Dec 10 03:24:37 AEDT 2014


From: Ananth N Mavinakayanahalli <ananth at in.ibm.com>

Fix Wunused_result

Signed-off-by: Ananth N Mavinakayanahalli <ananth at in.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hw/fsp/fsp-surveillance.c |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/hw/fsp/fsp-surveillance.c b/hw/fsp/fsp-surveillance.c
index ebe19d6..dab3f31 100644
--- a/hw/fsp/fsp-surveillance.c
+++ b/hw/fsp/fsp-surveillance.c
@@ -92,6 +92,7 @@ static void fsp_surv_check_timeout(void)
 static void fsp_surv_hbeat(void)
 {
 	u64 now = mftb();
+	struct fsp_msg *msg;
 
 	/* Check if an ack is pending... if so, don't send the ping just yet */
 	if (fsp_surv_ack_pending) {
@@ -111,12 +112,19 @@ static void fsp_surv_hbeat(void)
 	    (tb_compare(now, surv_timer) == TB_AEQUALB)) {
 		prlog(PR_DEBUG,
 		      "SURV: Sending the hearbeat command to FSP\n");
-		fsp_queue_msg(fsp_mkmsg(FSP_CMD_SURV_HBEAT, 1, 120),
-			      fsp_surv_ack);
-
-		fsp_surv_ack_pending = true;
-		surv_timer = now + secs_to_tb(60);
-		surv_ack_timer = now + secs_to_tb(FSP_SURV_ACK_TIMEOUT);
+		msg = fsp_mkmsg(FSP_CMD_SURV_HBEAT, 1, 120);
+		if (!msg) {
+			prerror("SURV: Failed to allocate hbeat msg\n");
+			return;
+		}
+		if (fsp_queue_msg(msg, fsp_surv_ack)) {
+			fsp_freemsg(msg);
+			prerror("SURV: Failed to queue hbeat msg\n");
+		} else {
+			fsp_surv_ack_pending = true;
+			surv_timer = now + secs_to_tb(60);
+			surv_ack_timer = now + secs_to_tb(FSP_SURV_ACK_TIMEOUT);
+		}
 	}
 }
 



More information about the Skiboot mailing list