]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(psci): remove unreachable switch/case blocks
authorAndre Przywara <andre.przywara@arm.com>
Wed, 29 Mar 2023 11:05:19 +0000 (12:05 +0100)
committerManish Pandey <manish.pandey2@arm.com>
Tue, 4 Apr 2023 10:39:36 +0000 (12:39 +0200)
The PSCI function dispatcher switch/case is split up between 32-bit and
64-bit function IDs, based on bit 30 of the encoding. This bit just
encodes the maximum size of the arguments, not necessarily whether they
are used from AArch64 or AArch32. So while some functions exist in both
worlds (CPU_ON, for instance), some functions take no or only 32-bit
arguments (CPU_OFF, PSCI_FEATURES), so they only exist as a 32-bit
function call.

Commit b88a4416b5e5 ("feat(psci): add support for PSCI_SET_SUSPEND_MODE"
, gerrit ID Iebf65f5f7846aef6b8643ad6082db99b4dcc4bef) and commit
9a70e69e0598 ("feat(psci): update PSCI_FEATURES", gerrit ID
I5da8a989b53419ad2ab55b73ddeee6e882c25554) introduced two "case"
sections for 32-bit function IDs in the 64-bit branch, which will never
trigger. The one small extra case caused the sun50i_a64 DEBUG build to
go beyond its RAM limit.

Removed the redundant switch/case blocks, to make sun50i_a64 build
again.

Change-Id: Ic65b7403d128837296a0c3af42c6f23f9f57778e
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
lib/psci/psci_main.c

index 276c3a59f9822167da2d8d48ae8f699014856086..326f125b6360fcfc46445c4aa463031a88df2864 100644 (file)
@@ -567,10 +567,6 @@ u_register_t psci_smc_handler(uint32_t smc_fid,
                        ret = psci_migrate_info_up_cpu();
                        break;
 
-               case PSCI_FEATURES:
-                       ret = (u_register_t)psci_features(x1);
-                       break;
-
                case PSCI_NODE_HW_STATE_AARCH64:
                        ret = (u_register_t)psci_node_hw_state(
                                        x1, (unsigned int) x2);
@@ -580,12 +576,6 @@ u_register_t psci_smc_handler(uint32_t smc_fid,
                        ret = (u_register_t)psci_system_suspend(x1, x2);
                        break;
 
-#if PSCI_OS_INIT_MODE
-               case PSCI_SET_SUSPEND_MODE:
-                       ret = (u_register_t)psci_set_suspend_mode(x1);
-                       break;
-#endif
-
 #if ENABLE_PSCI_STAT
                case PSCI_STAT_RESIDENCY_AARCH64:
                        ret = psci_stat_residency(x1, (unsigned int) x2);