fix(psci): initialise variables
When building with LTO, GCC is uncomfortable that these variables are
uninitialised and complains that they may be used before they are
initialised. Set them to 0 as there are plenty of asserts to make sure
these branches cannot be taken.
Change-Id: Ic1f05e77252e93bdafab033dcb24ad42856ebf9a
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c
index 34de10f..34668ea 100644
--- a/lib/psci/psci_main.c
+++ b/lib/psci/psci_main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2024, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2025, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -305,7 +305,7 @@
int psci_migrate(u_register_t target_cpu)
{
int rc;
- u_register_t resident_cpu_mpidr;
+ u_register_t resident_cpu_mpidr = 0;
/* Validate the target cpu */
if (!is_valid_mpidr(target_cpu))
@@ -347,7 +347,7 @@
u_register_t psci_migrate_info_up_cpu(void)
{
- u_register_t resident_cpu_mpidr;
+ u_register_t resident_cpu_mpidr = 0;
int rc;
/*