diff mbox

[36/36] sparse: fix incorrect type in assignment in fsp-mem-err.c

Message ID 1447129110-21600-37-git-send-email-stewart@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Stewart Smith Nov. 10, 2015, 4:18 a.m. UTC
Since skiboot is all BE, no built code changes

hw/fsp/fsp-mem-err.c:215:35: warning: invalid assignment: |=
hw/fsp/fsp-mem-err.c:215:35:    left side has type restricted beint16_t
hw/fsp/fsp-mem-err.c:215:35:    right side has type int
hw/fsp/fsp-mem-err.c:228:57: warning: incorrect type in assignment (different base types)
hw/fsp/fsp-mem-err.c:228:57:    expected restricted beint64_t [addressable] [assigned] [usertype] physical_address_start
hw/fsp/fsp-mem-err.c:228:57:    got unsigned long long [unsigned] [usertype] paddr
hw/fsp/fsp-mem-err.c:229:55: warning: incorrect type in assignment (different base types)
hw/fsp/fsp-mem-err.c:229:55:    expected restricted beint64_t [addressable] [assigned] [usertype] physical_address_end
hw/fsp/fsp-mem-err.c:229:55:    got unsigned long long
hw/fsp/fsp-mem-err.c:269:65: warning: incorrect type in assignment (different base types)
hw/fsp/fsp-mem-err.c:269:65:    expected restricted beint64_t [usertype] physical_address_end
hw/fsp/fsp-mem-err.c:269:65:    got unsigned long long [unsigned] [usertype] paddr_end
hw/fsp/fsp-mem-err.c:318:58: warning: incorrect type in assignment (different base types)
hw/fsp/fsp-mem-err.c:318:58:    expected restricted beint64_t [addressable] [assigned] [usertype] physical_address_start
hw/fsp/fsp-mem-err.c:318:58:    got unsigned long long [unsigned] [usertype] paddr_start
hw/fsp/fsp-mem-err.c:319:56: warning: incorrect type in assignment (different base types)
hw/fsp/fsp-mem-err.c:319:56:    expected restricted beint64_t [addressable] [assigned] [usertype] physical_address_end
hw/fsp/fsp-mem-err.c:319:56:    got unsigned long long [unsigned] [usertype] paddr_end

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 hw/fsp/fsp-mem-err.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/hw/fsp/fsp-mem-err.c b/hw/fsp/fsp-mem-err.c
index 1f29a001f930..a2b0619ff7f2 100644
--- a/hw/fsp/fsp-mem-err.c
+++ b/hw/fsp/fsp-mem-err.c
@@ -212,7 +212,7 @@  static bool handle_memory_resilience(u32 cmd_sub_mod, u64 paddr)
 		 * For now, send corrected errors to linux and let
 		 * linux handle corrected errors thresholding.
 		 */
-		mem_err_evt.flags |= OPAL_MEM_CORRECTED_ERROR;
+		mem_err_evt.flags |= cpu_to_be16(OPAL_MEM_CORRECTED_ERROR);
 		mem_err_evt.u.resilience.resil_err_type =
 					OPAL_MEM_RESILIENCE_CE;
 		break;
@@ -225,9 +225,9 @@  static bool handle_memory_resilience(u32 cmd_sub_mod, u64 paddr)
 					OPAL_MEM_RESILIENCE_UE_SCRUB;
 		break;
 	}
-	mem_err_evt.u.resilience.physical_address_start = paddr;
+	mem_err_evt.u.resilience.physical_address_start = cpu_to_be64(paddr);
 	mem_err_evt.u.resilience.physical_address_end =
-					paddr + MEM_ERR_PAGE_SIZE_4K;
+		cpu_to_be64(paddr + MEM_ERR_PAGE_SIZE_4K);
 
 	/* Queue up the event and inform OS about it. */
 	rc = queue_mem_err_node(&mem_err_evt);
@@ -265,8 +265,8 @@  static bool update_memory_deallocation_event(u64 paddr_start, u64 paddr_end)
 			found = 1;
 			if (be64_to_cpu(merr_evt->u.dyn_dealloc.physical_address_end)
 								< paddr_end)
-				merr_evt->u.dyn_dealloc.physical_address_end
-								= paddr_end;
+				merr_evt->u.dyn_dealloc.physical_address_end =
+					cpu_to_be64(paddr_end);
 			break;
 		}
 	}
@@ -315,8 +315,8 @@  static bool handle_memory_deallocation(u64 paddr_start, u64 paddr_end)
 	mem_err_evt.type = OPAL_MEM_ERR_TYPE_DYN_DALLOC;
 	mem_err_evt.u.dyn_dealloc.dyn_err_type =
 					OPAL_MEM_DYNAMIC_DEALLOC;
-	mem_err_evt.u.dyn_dealloc.physical_address_start = paddr_start;
-	mem_err_evt.u.dyn_dealloc.physical_address_end = paddr_end;
+	mem_err_evt.u.dyn_dealloc.physical_address_start = cpu_to_be64(paddr_start);
+	mem_err_evt.u.dyn_dealloc.physical_address_end = cpu_to_be64(paddr_end);
 
 	/* Queue up the event and inform OS about it. */
 	rc = queue_mem_err_node(&mem_err_evt);