summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNariman Poushin <nariman.poushin@linaro.org>2018-05-01 09:28:40 +0100
committerNariman Poushin <nariman.poushin@linaro.org>2018-06-23 17:22:08 +0100
commit9b4c611c4b05fdf03722d2de488ea49beb10a8b7 (patch)
treee525e6796bbf2c73574c2f13e4939a40993d1f8f /include
parentb70dcbc17222687859ac1cf58d4d7c5cb5c379fe (diff)
plat/arm: css: Convert CSS_SYSTEM_PWR_STATE from macro to inline function
This is to fix a number of Coverity Scan DEADCODE defects, CID numbers listed below, as reported from https://scan.coverity.com/projects/arm-software-arm-trusted-firmware CID 267023 CID 267022 CID 267020 Change-Id: I2963a799b210149e84ccab5c5b9082267ddfe337 Signed-off-by: Nariman Poushin <nariman.poushin@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/plat/arm/css/common/css_pm.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/plat/arm/css/common/css_pm.h b/include/plat/arm/css/common/css_pm.h
index 0f92e60b..e834fffc 100644
--- a/include/plat/arm/css/common/css_pm.h
+++ b/include/plat/arm/css/common/css_pm.h
@@ -17,9 +17,15 @@
/* Macros to read the CSS power domain state */
#define CSS_CORE_PWR_STATE(state) (state)->pwr_domain_state[ARM_PWR_LVL0]
#define CSS_CLUSTER_PWR_STATE(state) (state)->pwr_domain_state[ARM_PWR_LVL1]
-#define CSS_SYSTEM_PWR_STATE(state) \
- ((PLAT_MAX_PWR_LVL == CSS_SYSTEM_PWR_DMN_LVL) ?\
- (state)->pwr_domain_state[CSS_SYSTEM_PWR_DMN_LVL] : 0)
+
+static inline unsigned int css_system_pwr_state(const psci_power_state_t *state)
+{
+#if (PLAT_MAX_PWR_LVL == CSS_SYSTEM_PWR_DMN_LVL)
+ return state->pwr_domain_state[CSS_SYSTEM_PWR_DMN_LVL];
+#else
+ return 0;
+#endif
+}
int css_pwr_domain_on(u_register_t mpidr);
void css_pwr_domain_on_finish(const psci_power_state_t *target_state);