diff mbox series

[1/4] core/hmi: fix endian conversion bug

Message ID 20220408153137.996621-2-npiggin@gmail.com
State New
Headers show
Series Build with little endian where possible | expand

Commit Message

Nicholas Piggin April 8, 2022, 3:31 p.m. UTC
Fix an endian conversion bug in HMI checkstop reporting.

Noticed by sparse.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 core/hmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mahesh J Salgaonkar April 9, 2022, 6:05 a.m. UTC | #1
On 2022-04-09 01:31:34 Sat, Nicholas Piggin wrote:
> Fix an endian conversion bug in HMI checkstop reporting.
> 
> Noticed by sparse.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>  core/hmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/core/hmi.c b/core/hmi.c
> index ce5abd7d6..46dc20dbb 100644
> --- a/core/hmi.c
> +++ b/core/hmi.c
> @@ -915,7 +915,7 @@ static void find_npu_checkstop_reason(int flat_chip_id,
>  		hmi_evt->severity = OpalHMI_SEV_WARNING;
>  		hmi_evt->type = OpalHMI_ERROR_MALFUNC_ALERT;
>  		hmi_evt->u.xstop_error.xstop_type = CHECKSTOP_TYPE_NPU;
> -		hmi_evt->u.xstop_error.xstop_reason = xstop_reason;
> +		hmi_evt->u.xstop_error.xstop_reason = cpu_to_be32(xstop_reason);

Acked-by: Mahesh Salgaonkar <mahesh@linux.ibm.com>

Thanks,
-Mahesh.

>  		hmi_evt->u.xstop_error.u.chip_id = cpu_to_be32(flat_chip_id);
>  
>  		/* Marking the event as recoverable so that we don't crash */
> -- 
> 2.23.0
> 
> _______________________________________________
> Skiboot mailing list
> Skiboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
diff mbox series

Patch

diff --git a/core/hmi.c b/core/hmi.c
index ce5abd7d6..46dc20dbb 100644
--- a/core/hmi.c
+++ b/core/hmi.c
@@ -915,7 +915,7 @@  static void find_npu_checkstop_reason(int flat_chip_id,
 		hmi_evt->severity = OpalHMI_SEV_WARNING;
 		hmi_evt->type = OpalHMI_ERROR_MALFUNC_ALERT;
 		hmi_evt->u.xstop_error.xstop_type = CHECKSTOP_TYPE_NPU;
-		hmi_evt->u.xstop_error.xstop_reason = xstop_reason;
+		hmi_evt->u.xstop_error.xstop_reason = cpu_to_be32(xstop_reason);
 		hmi_evt->u.xstop_error.u.chip_id = cpu_to_be32(flat_chip_id);
 
 		/* Marking the event as recoverable so that we don't crash */