SPM: Clean up conditional code
Rather than a "ifndef TFM_PSA_API" followed by a "ifdef TFM_PSA_API",
combine the two using "else".
Signed-off-by: Chris Brand <chris.brand@cypress.com>
Change-Id: Ie8cc6745dcd78caa1e685df23b01c1efdff1a7c0
diff --git a/secure_fw/spm/include/tfm_secure_api.h b/secure_fw/spm/include/tfm_secure_api.h
index 21c988b..e299fc3 100644
--- a/secure_fw/spm/include/tfm_secure_api.h
+++ b/secure_fw/spm/include/tfm_secure_api.h
@@ -1,5 +1,7 @@
/*
* Copyright (c) 2017-2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2022 Cypress Semiconductor Corporation (an Infineon company)
+ * or an affiliate of Cypress Semiconductor Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -22,27 +24,8 @@
#include "tfm_core_svc.h"
#endif /* TFM_PSA_API */
-#ifndef TFM_MULTI_CORE_TOPOLOGY
-#ifndef TFM_PSA_API
-/*!
- * \def __tfm_secure_gateway_attributes__
- *
- * \brief Attributes for secure gateway functions
- */
-#if defined(__GNUC__) && !defined(__ARMCC_VERSION)
-/*
- * GNUARM requires noclone attribute to protect gateway function symbol from
- * being renamed and cloned
- */
-#define __tfm_secure_gateway_attributes__ \
- __attribute__((cmse_nonsecure_entry, noclone, section("SFN")))
-#else
-#define __tfm_secure_gateway_attributes__ \
- __attribute__((cmse_nonsecure_entry, section("SFN")))
-#endif /* __GNUC__ && !__ARMCC_VERSION */
-#endif /* !TFM_PSA_API */
-
#ifdef TFM_PSA_API
+#ifndef TFM_MULTI_CORE_TOPOLOGY
/*!
* \def __tfm_psa_secure_gateway_attributes__
*
@@ -59,8 +42,25 @@
#define __tfm_psa_secure_gateway_attributes__ \
__attribute__((cmse_nonsecure_entry, naked, section("SFN")))
#endif /* __GNUC__ && !__ARMCC_VERSION */
-#endif /* TFM_PSA_API */
#endif /* TFM_MULTI_CORE_TOPOLOGY */
+#else /* TFM_PSA_API */
+/*!
+ * \def __tfm_secure_gateway_attributes__
+ *
+ * \brief Attributes for secure gateway functions
+ */
+#if defined(__GNUC__) && !defined(__ARMCC_VERSION)
+/*
+ * GNUARM requires noclone attribute to protect gateway function symbol from
+ * being renamed and cloned
+ */
+#define __tfm_secure_gateway_attributes__ \
+ __attribute__((cmse_nonsecure_entry, noclone, section("SFN")))
+#else
+#define __tfm_secure_gateway_attributes__ \
+ __attribute__((cmse_nonsecure_entry, section("SFN")))
+#endif /* __GNUC__ && !__ARMCC_VERSION */
+#endif /* TFM_PSA_API */
/* Hide specific errors if not debugging */
#ifdef TFM_CORE_DEBUG