From 97373c33b70725daf58e4491831537392c0d5239 Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Wed, 18 Jul 2018 11:57:21 +0100 Subject: PSCI: Replace macros by static inline functions Fix MISRA C-2012 Directive 4.9 and Rule 21.1 defects. Change-Id: I96c216317d38741ee632d2640cd7b36e6723d5c2 Signed-off-by: Antonio Nino Diaz --- lib/psci/psci_common.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'lib/psci/psci_common.c') diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c index 2220a745..bb228b25 100644 --- a/lib/psci/psci_common.c +++ b/lib/psci/psci_common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -93,11 +93,19 @@ typedef enum plat_local_state_type { STATE_TYPE_OFF } plat_local_state_type_t; -/* The macro used to categorize plat_local_state. */ -#define find_local_state_type(plat_local_state) \ - ((plat_local_state) ? ((plat_local_state > PLAT_MAX_RET_STATE) \ - ? STATE_TYPE_OFF : STATE_TYPE_RETN) \ - : STATE_TYPE_RUN) +/* Function used to categorize plat_local_state. */ +static plat_local_state_type_t find_local_state_type(plat_local_state_t state) +{ + if (state != 0U) { + if (state > PLAT_MAX_RET_STATE) { + return STATE_TYPE_OFF; + } else { + return STATE_TYPE_RETN; + } + } else { + return STATE_TYPE_RUN; + } +} /****************************************************************************** * Check that the maximum retention level supported by the platform is less -- cgit v1.2.3