[Skiboot] [PATCH 21/36] sparse: fix endian annotation warnings in ipmi-rtc.c

Stewart Smith stewart at linux.vnet.ibm.com
Tue Nov 10 15:18:15 AEDT 2015


hw/ipmi/ipmi-rtc.c:41:28: warning: incorrect type in argument 1 (different base types)
hw/ipmi/ipmi-rtc.c:41:28:    expected restricted leint32_t [usertype] le_val
hw/ipmi/ipmi-rtc.c:41:28:    got unsigned int [unsigned] [addressable] [usertype] result
hw/ipmi/ipmi-rtc.c:66:12: warning: incorrect type in assignment (different base types)
hw/ipmi/ipmi-rtc.c:66:12:    expected unsigned int [unsigned] [usertype] tv
hw/ipmi/ipmi-rtc.c:66:12:    got restricted leint32_t

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 hw/ipmi/ipmi-rtc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/ipmi/ipmi-rtc.c b/hw/ipmi/ipmi-rtc.c
index 01fb3e1ba0ab..ba6f9777d1c5 100644
--- a/hw/ipmi/ipmi-rtc.c
+++ b/hw/ipmi/ipmi-rtc.c
@@ -34,7 +34,7 @@ static void get_sel_time_error(struct ipmi_msg *msg)
 static void get_sel_time_complete(struct ipmi_msg *msg)
 {
 	struct tm tm;
-	uint32_t result;
+	le32 result;
 	time_t time;
 
 	memcpy(&result, msg->data, 4);
@@ -59,12 +59,12 @@ static int64_t ipmi_get_sel_time(void)
 	return ipmi_queue_msg(msg);
 }
 
-static int64_t ipmi_set_sel_time(uint32_t tv)
+static int64_t ipmi_set_sel_time(uint32_t _tv)
 {
 	struct ipmi_msg *msg;
+	const le32 tv = cpu_to_le32(_tv);
 
-	tv = cpu_to_le32(tv);
-	msg = ipmi_mkmsg_simple(IPMI_SET_SEL_TIME, &tv, sizeof(tv));
+	msg = ipmi_mkmsg_simple(IPMI_SET_SEL_TIME, (void*)&tv, sizeof(tv));
 	if (!msg)
 		return OPAL_HARDWARE;
 
-- 
2.1.4



More information about the Skiboot mailing list