[PATCH 4/4] hab: habv4: apply sizeof() to correct object

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Sep 21 02:56:49 PDT 2023


This introduces no functional change, because sizeof(enum habv4_state)
== sizeof(enum hab_config), but it's the correct thing to do.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/hab/habv4.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
index bbceb0e985b6..e65dc8756e17 100644
--- a/drivers/hab/habv4.c
+++ b/drivers/hab/habv4.c
@@ -178,20 +178,20 @@ static enum hab_status hab_sip_report_status(enum hab_config *config,
 
 	if (state)
 		v8_flush_dcache_range((unsigned long)state,
-				      (unsigned long)state + sizeof(*config));
+				      (unsigned long)state + sizeof(*state));
 	if (config)
 		v8_flush_dcache_range((unsigned long)config,
-				      (unsigned long)config + sizeof(*state));
+				      (unsigned long)config + sizeof(*config));
 
 	arm_smccc_smc(FSL_SIP_HAB, FSL_SIP_HAB_REPORT_STATUS,
 		      (unsigned long) config,
 		      (unsigned long) state, 0, 0, 0, 0, &res);
 	if (state)
 		v8_inv_dcache_range((unsigned long)state,
-				    (unsigned long)state + sizeof(*config));
+				    (unsigned long)state + sizeof(*state));
 	if (config)
 		v8_inv_dcache_range((unsigned long)config,
-				    (unsigned long)config + sizeof(*state));
+				    (unsigned long)config + sizeof(*config));
 	return (enum hab_status)res.a0;
 }
 
-- 
2.39.2




More information about the barebox mailing list