[Skiboot] [PATCH 2/6] RTC: Fix unused result warnings in RTC driver

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Wed Dec 10 03:24:25 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-rtc.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/hw/fsp/fsp-rtc.c b/hw/fsp/fsp-rtc.c
index 704648e..f60d2f3 100644
--- a/hw/fsp/fsp-rtc.c
+++ b/hw/fsp/fsp-rtc.c
@@ -457,8 +457,17 @@ static void rtc_flush_cached_tod(void)
 		return;
 	msg = fsp_mkmsg(FSP_CMD_WRITE_TOD, 3, y_m_d,
 			(h_m_s_m >> 32) & 0xffffff00, 0);
-	if (msg)
-		fsp_queue_msg(msg, fsp_freemsg);
+	if (!msg) {
+		prerror("TPO: %s : Failed to allocate write TOD message\n",
+			__func__);
+		return;
+	}
+	if (fsp_queue_msg(msg, fsp_freemsg)) {
+		fsp_freemsg(msg);
+		prerror("TPO: %s : Failed to queue WRITE_TOD command\n",
+			__func__);
+		return;
+	}
 }
 
 static bool fsp_rtc_msg_rr(u32 cmd_sub_mod, struct fsp_msg *msg)



More information about the Skiboot mailing list