aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Kay <chris.kay@arm.com>2020-07-29 22:47:19 +0100
committerjimqui01 <54316584+jimqui01@users.noreply.github.com>2020-08-28 16:48:19 +0100
commit22dccffbd8eb3885081ac702f316be826b58ea57 (patch)
treef91286552a023c4548c1d7129dcb7ce1f3ab8f46
parent0051b203027f58b942ccd5e8a43e74bcca6cdddd (diff)
misc: Replace `#if BUILD_X` with `#ifdef`
Build system conditional variables do not set a zero value when not set, but rather are simply not defined. Relying on a lack of a definition to evaluate to 0 is potentially unsafe, as it can mask logical errors. Change-Id: Ic1281fae2da176cad224514f355ff00886abe04c Signed-off-by: Chris Kay <chris.kay@arm.com>
-rw-r--r--module/clock/include/mod_clock.h2
-rw-r--r--module/pik_clock/src/mod_pik_clock.c24
-rw-r--r--module/pl011/src/mod_pl011.c8
-rw-r--r--module/power_domain/include/mod_power_domain.h6
-rw-r--r--module/ppu_v0/src/mod_ppu_v0.c14
-rw-r--r--module/ppu_v1/src/mod_ppu_v1.c14
-rw-r--r--module/scmi_power_domain/src/mod_scmi_power_domain.c24
-rw-r--r--module/sds/include/mod_sds.h2
-rw-r--r--module/sds/src/mod_sds.c10
-rw-r--r--module/system_power/include/mod_system_power.h4
-rw-r--r--product/juno/module/juno_ppu/src/mod_juno_ppu.c10
-rw-r--r--product/juno/scp_ramfw/config_scmi_power_domain.c2
-rw-r--r--product/n1sdp/module/n1sdp_smt/src/mod_smt.c6
-rw-r--r--product/synquacer/module/ppu_v0_synquacer/src/mod_ppu_v0.c10
-rw-r--r--product/synquacer/module/synquacer_pik_clock/src/mod_synquacer_pik_clock.c4
15 files changed, 70 insertions, 70 deletions
diff --git a/module/clock/include/mod_clock.h b/module/clock/include/mod_clock.h
index 00b14219..d1e23a9f 100644
--- a/module/clock/include/mod_clock.h
+++ b/module/clock/include/mod_clock.h
@@ -55,7 +55,7 @@ enum mod_clock_notification_idx {
MOD_CLOCK_NOTIFICATION_IDX_COUNT
};
-#if BUILD_HAS_MOD_CLOCK
+#ifdef BUILD_HAS_MOD_CLOCK
/*!
* \brief Identifier for the \ref MOD_CLOCK_NOTIFICATION_IDX_STATE_CHANGED
* notification.
diff --git a/module/pik_clock/src/mod_pik_clock.c b/module/pik_clock/src/mod_pik_clock.c
index 946d3c6c..cb8aef6e 100644
--- a/module/pik_clock/src/mod_pik_clock.c
+++ b/module/pik_clock/src/mod_pik_clock.c
@@ -523,7 +523,7 @@ static const struct mod_clock_drv_api api_clock = {
* Direct driver API functions
*/
-#if BUILD_HAS_MOD_CSS_CLOCK
+#ifdef BUILD_HAS_MOD_CSS_CLOCK
static int pik_clock_direct_set_div(fwk_id_t clock_id, uint32_t divider_type,
uint32_t divider)
{
@@ -696,17 +696,17 @@ static int pik_clock_process_bind_request(fwk_id_t source_id,
ctx = module_ctx.dev_ctx_table + fwk_id_get_element_idx(target_id);
if (ctx->config->is_group_member) {
- #if BUILD_HAS_MOD_CSS_CLOCK
- /* Only the CSS Clock module can bind to group members. */
- if (fwk_id_get_module_idx(source_id) == FWK_MODULE_IDX_CSS_CLOCK) {
- *api = &api_direct;
- return FWK_SUCCESS;
- } else
- return FWK_E_ACCESS;
- #else
- /* The CSS Clock module is required to support group members. */
- return FWK_E_SUPPORT;
- #endif
+#ifdef BUILD_HAS_MOD_CSS_CLOCK
+ /* Only the CSS Clock module can bind to group members. */
+ if (fwk_id_get_module_idx(source_id) == FWK_MODULE_IDX_CSS_CLOCK) {
+ *api = &api_direct;
+ return FWK_SUCCESS;
+ } else
+ return FWK_E_ACCESS;
+#else
+ /* The CSS Clock module is required to support group members. */
+ return FWK_E_SUPPORT;
+#endif
} else
*api = &api_clock;
diff --git a/module/pl011/src/mod_pl011.c b/module/pl011/src/mod_pl011.c
index fa9d0f41..20a9c246 100644
--- a/module/pl011/src/mod_pl011.c
+++ b/module/pl011/src/mod_pl011.c
@@ -12,7 +12,7 @@
#include <mod_pl011.h>
#include <mod_power_domain.h>
-#if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
# include <mod_system_power.h>
#endif
@@ -228,7 +228,7 @@ static int pl011_start(fwk_id_t id)
* Subscribe to power domain pre-state change notifications when identifier
* is provided.
*/
- #if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
int status;
if (!fwk_id_is_type(config->pd_id, FWK_ID_TYPE_NONE)) {
status = fwk_notification_subscribe(
@@ -278,7 +278,7 @@ static int process_clock_notification(
return FWK_SUCCESS;
}
-#if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
static int pl011_powerdown(fwk_id_t id)
{
int status;
@@ -341,7 +341,7 @@ static int pl011_process_notification(
* Clock notification
*/
return process_clock_notification(event, resp_event);
- #if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
} else if (fwk_id_is_equal(
event->id,
mod_pd_notification_id_power_state_pre_transition)) {
diff --git a/module/power_domain/include/mod_power_domain.h b/module/power_domain/include/mod_power_domain.h
index 6a4a0400..f0d6fc5d 100644
--- a/module/power_domain/include/mod_power_domain.h
+++ b/module/power_domain/include/mod_power_domain.h
@@ -758,7 +758,7 @@ enum mod_pd_api_idx {
MOD_PD_API_IDX_COUNT,
};
-#if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
/*! Public API identifier */
static const fwk_id_t mod_pd_api_id_public =
FWK_ID_API_INIT(FWK_MODULE_IDX_POWER_DOMAIN, MOD_PD_API_IDX_PUBLIC);
@@ -792,7 +792,7 @@ enum mod_pd_notification_idx {
/*!
* \brief Notification identifiers.
*/
-#if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
/*! Identifier of the power state transition notification */
static const fwk_id_t mod_pd_notification_id_power_state_transition =
FWK_ID_NOTIFICATION_INIT(FWK_MODULE_IDX_POWER_DOMAIN,
@@ -866,7 +866,7 @@ struct pd_get_state_response {
/*!
* \brief Public Events identifiers.
*/
-#if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
/*! Identifier of the public event set_state identifier */
static const fwk_id_t mod_pd_public_event_id_set_state =
FWK_ID_EVENT_INIT(FWK_MODULE_IDX_POWER_DOMAIN,
diff --git a/module/ppu_v0/src/mod_ppu_v0.c b/module/ppu_v0/src/mod_ppu_v0.c
index 31e80b58..e90dfd4b 100644
--- a/module/ppu_v0/src/mod_ppu_v0.c
+++ b/module/ppu_v0/src/mod_ppu_v0.c
@@ -13,7 +13,7 @@
#include <mod_power_domain.h>
#include <mod_ppu_v0.h>
-#if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
# include <mod_system_power.h>
#endif
@@ -194,7 +194,7 @@ static int ppu_v0_pd_init(fwk_id_t pd_id, unsigned int unused, const void *data)
pd_ctx->ppu = (struct ppu_v0_reg *)(config->ppu.reg_base);
pd_ctx->bound_id = FWK_ID_NONE;
-#if BUILD_HAS_MOD_TIMER
+#ifdef BUILD_HAS_MOD_TIMER
if (config->timer_config == NULL) {
pd_ctx->timer_ctx = NULL;
} else {
@@ -243,7 +243,7 @@ static int ppu_v0_bind(fwk_id_t id, unsigned int round)
pd_ctx = ppu_v0_ctx.pd_ctx_table + fwk_id_get_element_idx(id);
-#if BUILD_HAS_MOD_TIMER
+#ifdef BUILD_HAS_MOD_TIMER
if (pd_ctx->timer_ctx != NULL) {
/* Bind to the timer */
status = fwk_module_bind(
@@ -259,7 +259,7 @@ static int ppu_v0_bind(fwk_id_t id, unsigned int round)
return FWK_SUCCESS;
switch (fwk_id_get_module_idx(pd_ctx->bound_id)) {
- #if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
case FWK_MODULE_IDX_POWER_DOMAIN:
return fwk_module_bind(pd_ctx->bound_id,
mod_pd_api_id_driver_input,
@@ -267,7 +267,7 @@ static int ppu_v0_bind(fwk_id_t id, unsigned int round)
break;
#endif
- #if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
case FWK_MODULE_IDX_SYSTEM_POWER:
return fwk_module_bind(pd_ctx->bound_id,
mod_system_power_api_id_pd_driver_input,
@@ -300,14 +300,14 @@ static int ppu_v0_process_bind_request(fwk_id_t source_id,
case MOD_PD_TYPE_DEVICE:
case MOD_PD_TYPE_DEVICE_DEBUG:
- #if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
if (fwk_id_get_module_idx(source_id) == FWK_MODULE_IDX_POWER_DOMAIN) {
pd_ctx->bound_id = source_id;
*api = &pd_driver;
break;
}
#endif
- #if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
if (fwk_id_get_module_idx(source_id) == FWK_MODULE_IDX_SYSTEM_POWER) {
pd_ctx->bound_id = source_id;
*api = &pd_driver;
diff --git a/module/ppu_v1/src/mod_ppu_v1.c b/module/ppu_v1/src/mod_ppu_v1.c
index 7fb0f2ad..2a31a27b 100644
--- a/module/ppu_v1/src/mod_ppu_v1.c
+++ b/module/ppu_v1/src/mod_ppu_v1.c
@@ -13,7 +13,7 @@
#include <mod_power_domain.h>
#include <mod_ppu_v1.h>
-#if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
# include <mod_system_power.h>
#endif
@@ -682,7 +682,7 @@ static int ppu_v1_pd_init(fwk_id_t pd_id, unsigned int unused, const void *data)
if (config->pd_type == MOD_PD_TYPE_CLUSTER) {
pd_ctx->data = fwk_mm_calloc(1, sizeof(struct ppu_v1_cluster_pd_ctx));
}
-#if BUILD_HAS_MOD_TIMER
+#ifdef BUILD_HAS_MOD_TIMER
if (config->timer_config == NULL) {
pd_ctx->timer_ctx = NULL;
} else {
@@ -768,7 +768,7 @@ static int ppu_v1_bind(fwk_id_t id, unsigned int round)
pd_ctx = ppu_v1_ctx.pd_ctx_table + fwk_id_get_element_idx(id);
-#if BUILD_HAS_MOD_TIMER
+#ifdef BUILD_HAS_MOD_TIMER
if (pd_ctx->timer_ctx != NULL &&
!fwk_id_is_equal(pd_ctx->timer_ctx->timer_id, FWK_ID_NONE)) {
/* Bind to the timer */
@@ -799,7 +799,7 @@ static int ppu_v1_bind(fwk_id_t id, unsigned int round)
return FWK_SUCCESS;
switch (fwk_id_get_module_idx(pd_ctx->bound_id)) {
- #if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
case FWK_MODULE_IDX_POWER_DOMAIN:
return fwk_module_bind(pd_ctx->bound_id,
mod_pd_api_id_driver_input,
@@ -807,7 +807,7 @@ static int ppu_v1_bind(fwk_id_t id, unsigned int round)
break;
#endif
- #if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
case FWK_MODULE_IDX_SYSTEM_POWER:
return fwk_module_bind(pd_ctx->bound_id,
mod_system_power_api_id_pd_driver_input,
@@ -860,11 +860,11 @@ static int ppu_v1_process_bind_request(fwk_id_t source_id,
return FWK_E_ACCESS;
}
- #if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
is_power_domain_module = (fwk_id_get_module_idx(source_id) ==
FWK_MODULE_IDX_POWER_DOMAIN);
#endif
- #if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
is_system_power_module = (fwk_id_get_module_idx(source_id) ==
FWK_MODULE_IDX_SYSTEM_POWER);
#endif
diff --git a/module/scmi_power_domain/src/mod_scmi_power_domain.c b/module/scmi_power_domain/src/mod_scmi_power_domain.c
index 00718c7f..ee278e97 100644
--- a/module/scmi_power_domain/src/mod_scmi_power_domain.c
+++ b/module/scmi_power_domain/src/mod_scmi_power_domain.c
@@ -53,7 +53,7 @@ struct scmi_pd_ctx {
/* Power domain module API */
const struct mod_pd_restricted_api *pd_api;
- #if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
/* Debug module API */
const struct mod_debug_api *debug_api;
@@ -68,7 +68,7 @@ struct scmi_pd_ctx {
/* Pointer to a table of scmi_pd operations */
struct scmi_pd_operations *ops;
-#if BUILD_HAS_RESOURCE_PERMISSIONS
+#ifdef BUILD_HAS_RESOURCE_PERMISSIONS
/* SCMI Resource Permissions API */
const struct mod_res_permissions_api *res_perms_api;
#endif
@@ -87,7 +87,7 @@ static int scmi_pd_power_state_set_handler(fwk_id_t service_id,
static int scmi_pd_power_state_get_handler(fwk_id_t service_id,
const uint32_t *payload);
-#if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
enum scmi_clock_event_idx {
/* Event used prior to send a set_enabled request to debug HAL. */
SCMI_PD_EVENT_IDX_DEBUG_SET,
@@ -149,7 +149,7 @@ static uint32_t pd_state_to_scmi_dev_state[] = {
* Helpers
*/
-#if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
static bool ops_is_busy(fwk_id_t pd_id)
{
unsigned int pd_idx = fwk_id_get_element_idx(pd_id);
@@ -473,7 +473,7 @@ static int scmi_pd_power_state_set_handler(fwk_id_t service_id,
case MOD_PD_TYPE_DEVICE_DEBUG:
- #if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
if (!is_sync) {
return_values.status = SCMI_NOT_SUPPORTED;
goto exit;
@@ -561,7 +561,7 @@ static int scmi_pd_power_state_get_handler(fwk_id_t service_id,
enum mod_pd_type pd_type;
unsigned int pd_power_state;
unsigned int power_state;
- #if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
struct fwk_event event;
struct event_request_params *event_params;
#endif
@@ -591,7 +591,7 @@ static int scmi_pd_power_state_get_handler(fwk_id_t service_id,
break;
case MOD_PD_TYPE_DEVICE_DEBUG:
- #if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
event = (struct fwk_event){
.target_id = fwk_module_id_scmi_power_domain,
.id = mod_scmi_pd_event_id_dbg_enable_get,
@@ -801,7 +801,7 @@ static struct mod_scmi_to_protocol_api scmi_pd_mod_scmi_to_protocol_api = {
static int scmi_pd_init(fwk_id_t module_id, unsigned int element_count,
const void *data)
{
- #if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
struct mod_scmi_pd_config *config = (struct mod_scmi_pd_config *)data;
#endif
@@ -819,7 +819,7 @@ static int scmi_pd_init(fwk_id_t module_id, unsigned int element_count,
if (scmi_pd_ctx.domain_count > UINT16_MAX)
scmi_pd_ctx.domain_count = UINT16_MAX;
- #if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
if (config == NULL)
return FWK_E_PARAM;
@@ -858,7 +858,7 @@ static int scmi_pd_bind(fwk_id_t id, unsigned int round)
if (status != FWK_SUCCESS)
return status;
- #if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
status = fwk_module_bind(scmi_pd_ctx.debug_id,
FWK_ID_API(FWK_MODULE_IDX_DEBUG, MOD_DEBUG_API_IDX_HAL),
&scmi_pd_ctx.debug_api);
@@ -890,7 +890,7 @@ static int scmi_pd_process_bind_request(fwk_id_t source_id, fwk_id_t target_id,
return FWK_SUCCESS;
}
-#if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
static int process_request_event(const struct fwk_event *event)
{
struct event_request_params *params;
@@ -1043,7 +1043,7 @@ const struct fwk_module module_scmi_power_domain = {
.init = scmi_pd_init,
.bind = scmi_pd_bind,
.process_bind_request = scmi_pd_process_bind_request,
-#if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
.event_count = SCMI_PD_EVENT_IDX_COUNT,
.process_event = scmi_pd_process_event,
#endif
diff --git a/module/sds/include/mod_sds.h b/module/sds/include/mod_sds.h
index 1013e324..6005b203 100644
--- a/module/sds/include/mod_sds.h
+++ b/module/sds/include/mod_sds.h
@@ -117,7 +117,7 @@ struct mod_sds_config {
*/
unsigned int region_count;
-#if BUILD_HAS_MOD_CLOCK
+#ifdef BUILD_HAS_MOD_CLOCK
/*! Identifier of the clock that this module depends on */
fwk_id_t clock_id;
#endif
diff --git a/module/sds/src/mod_sds.c b/module/sds/src/mod_sds.c
index cb678905..af21a698 100644
--- a/module/sds/src/mod_sds.c
+++ b/module/sds/src/mod_sds.c
@@ -7,7 +7,7 @@
#include <mod_sds.h>
-#if BUILD_HAS_MOD_CLOCK
+#ifdef BUILD_HAS_MOD_CLOCK
# include <mod_clock.h>
#endif
@@ -614,14 +614,14 @@ static int sds_process_bind_request(fwk_id_t requester_id, fwk_id_t id,
static int sds_start(fwk_id_t id)
{
-#if BUILD_HAS_MOD_CLOCK
+#ifdef BUILD_HAS_MOD_CLOCK
const struct mod_sds_config *config;
#endif
if (!fwk_id_is_type(id, FWK_ID_TYPE_MODULE))
return FWK_SUCCESS;
-#if BUILD_HAS_MOD_CLOCK
+#ifdef BUILD_HAS_MOD_CLOCK
config = fwk_module_get_data(fwk_module_id_sds);
if (!fwk_id_is_equal(config->clock_id, FWK_ID_NONE)) {
/* Register the module for clock state notifications */
@@ -635,7 +635,7 @@ static int sds_start(fwk_id_t id)
return init_sds();
}
-#if BUILD_HAS_MOD_CLOCK
+#ifdef BUILD_HAS_MOD_CLOCK
static int sds_process_notification(
const struct fwk_event *event,
struct fwk_event *resp_event)
@@ -665,7 +665,7 @@ const struct fwk_module module_sds = {
.element_init = sds_element_init,
.process_bind_request = sds_process_bind_request,
.start = sds_start,
-#if BUILD_HAS_MOD_CLOCK
+#ifdef BUILD_HAS_MOD_CLOCK
.process_notification = sds_process_notification
#endif
};
diff --git a/module/system_power/include/mod_system_power.h b/module/system_power/include/mod_system_power.h
index 49e3c620..bac5b725 100644
--- a/module/system_power/include/mod_system_power.h
+++ b/module/system_power/include/mod_system_power.h
@@ -135,7 +135,7 @@ struct mod_system_power_driver_api {
* \brief API indices.
*/
enum mod_system_power_api_idx {
-#if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
/*! API index for the power domain driver API */
MOD_SYSTEM_POWER_API_IDX_PD_DRIVER,
@@ -147,7 +147,7 @@ enum mod_system_power_api_idx {
MOD_SYSTEM_POWER_API_COUNT
};
-#if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
/*! Identifier of the power domain driver API */
static const fwk_id_t mod_system_power_api_id_pd_driver =
FWK_ID_API_INIT(FWK_MODULE_IDX_SYSTEM_POWER,
diff --git a/product/juno/module/juno_ppu/src/mod_juno_ppu.c b/product/juno/module/juno_ppu/src/mod_juno_ppu.c
index 784939e7..4cc1f92c 100644
--- a/product/juno/module/juno_ppu/src/mod_juno_ppu.c
+++ b/product/juno/module/juno_ppu/src/mod_juno_ppu.c
@@ -780,7 +780,7 @@ static int juno_ppu_module_init(fwk_id_t module_id,
juno_ppu_ctx.dbgsys_state = MOD_PD_STATE_OFF;
- #if BUILD_HAS_MOD_TIMER
+#ifdef BUILD_HAS_MOD_TIMER
fwk_assert(data != NULL);
#endif
@@ -833,7 +833,7 @@ static int juno_ppu_bind(fwk_id_t id, unsigned int round)
return FWK_SUCCESS;
if (fwk_id_is_type(id, FWK_ID_TYPE_MODULE)) {
- #if BUILD_HAS_MOD_TIMER
+#ifdef BUILD_HAS_MOD_TIMER
config = fwk_module_get_data(fwk_module_id_juno_ppu);
status = fwk_module_bind(
@@ -850,7 +850,7 @@ static int juno_ppu_bind(fwk_id_t id, unsigned int round)
ppu_ctx = juno_ppu_ctx.ppu_ctx_table + fwk_id_get_element_idx(id);
dev_config = ppu_ctx->config;
- #if BUILD_HAS_MOD_TIMER
+#ifdef BUILD_HAS_MOD_TIMER
if (!fwk_id_is_equal(dev_config->timer_id, FWK_ID_NONE)) {
/* Bind to the timer */
status = fwk_module_bind(dev_config->timer_id,
@@ -863,7 +863,7 @@ static int juno_ppu_bind(fwk_id_t id, unsigned int round)
if (!fwk_id_is_equal(ppu_ctx->bound_id, FWK_ID_NONE)) {
/* Bind back to the entity that bound to us (if any) */
switch (fwk_id_get_module_idx(ppu_ctx->bound_id)) {
- #if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
case FWK_MODULE_IDX_POWER_DOMAIN:
/* Bind back to the PD module */
status = fwk_module_bind(ppu_ctx->bound_id,
@@ -874,7 +874,7 @@ static int juno_ppu_bind(fwk_id_t id, unsigned int round)
break;
#endif
- #if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
case FWK_MODULE_IDX_SYSTEM_POWER:
/* Bind back to the System Power module */
status = fwk_module_bind(ppu_ctx->bound_id,
diff --git a/product/juno/scp_ramfw/config_scmi_power_domain.c b/product/juno/scp_ramfw/config_scmi_power_domain.c
index 04a63910..fea8e017 100644
--- a/product/juno/scp_ramfw/config_scmi_power_domain.c
+++ b/product/juno/scp_ramfw/config_scmi_power_domain.c
@@ -14,7 +14,7 @@
#include <fwk_module.h>
#include <fwk_module_idx.h>
-#if BUILD_HAS_MOD_DEBUG
+#ifdef BUILD_HAS_MOD_DEBUG
struct fwk_module_config config_scmi_power_domain = {
.data = &((struct mod_scmi_pd_config) {
.debug_pd_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_POWER_DOMAIN,
diff --git a/product/n1sdp/module/n1sdp_smt/src/mod_smt.c b/product/n1sdp/module/n1sdp_smt/src/mod_smt.c
index f87e0490..92fca8a0 100644
--- a/product/n1sdp/module/n1sdp_smt/src/mod_smt.c
+++ b/product/n1sdp/module/n1sdp_smt/src/mod_smt.c
@@ -475,7 +475,7 @@ static int smt_start(fwk_id_t id)
ctx = &smt_ctx.channel_ctx_table[fwk_id_get_element_idx(id)];
-#if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
/* Register for power domain state transition notifications */
return fwk_notification_subscribe(
mod_pd_notification_id_power_state_transition,
@@ -493,7 +493,7 @@ static int smt_start(fwk_id_t id)
#endif
}
-#if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
static int smt_process_notification(
const struct fwk_event *event,
struct fwk_event *resp_event)
@@ -535,7 +535,7 @@ const struct fwk_module module_n1sdp_smt = {
.bind = smt_bind,
.start = smt_start,
.process_bind_request = smt_process_bind_request,
-#if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
.process_notification = smt_process_notification,
#endif
};
diff --git a/product/synquacer/module/ppu_v0_synquacer/src/mod_ppu_v0.c b/product/synquacer/module/ppu_v0_synquacer/src/mod_ppu_v0.c
index 998c65fb..3048208b 100644
--- a/product/synquacer/module/ppu_v0_synquacer/src/mod_ppu_v0.c
+++ b/product/synquacer/module/ppu_v0_synquacer/src/mod_ppu_v0.c
@@ -21,7 +21,7 @@
#include <stddef.h>
#include <stdint.h>
-#if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
# include <mod_system_power.h>
#endif
#include <ppu_v0.h>
@@ -274,7 +274,7 @@ static int ppu_v0_bind(fwk_id_t id, unsigned int round)
return FWK_SUCCESS;
switch (fwk_id_get_module_idx(pd_ctx->bound_id)) {
-#if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
case FWK_MODULE_IDX_POWER_DOMAIN:
return fwk_module_bind(
pd_ctx->bound_id,
@@ -283,7 +283,7 @@ static int ppu_v0_bind(fwk_id_t id, unsigned int round)
break;
#endif
-#if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
case FWK_MODULE_IDX_SYSTEM_POWER:
return fwk_module_bind(
pd_ctx->bound_id,
@@ -320,14 +320,14 @@ static int ppu_v0_process_bind_request(
case MOD_PD_TYPE_DEVICE_DEBUG:
case MOD_PD_TYPE_CLUSTER:
case MOD_PD_TYPE_CORE:
-#if BUILD_HAS_MOD_POWER_DOMAIN
+#ifdef BUILD_HAS_MOD_POWER_DOMAIN
if (fwk_id_get_module_idx(source_id) == FWK_MODULE_IDX_POWER_DOMAIN) {
pd_ctx->bound_id = source_id;
*api = &pd_driver;
break;
}
#endif
-#if BUILD_HAS_MOD_SYSTEM_POWER
+#ifdef BUILD_HAS_MOD_SYSTEM_POWER
if (fwk_id_get_module_idx(source_id) == FWK_MODULE_IDX_SYSTEM_POWER) {
*api = &pd_driver;
break;
diff --git a/product/synquacer/module/synquacer_pik_clock/src/mod_synquacer_pik_clock.c b/product/synquacer/module/synquacer_pik_clock/src/mod_synquacer_pik_clock.c
index 9e3cc6fb..8d8ba030 100644
--- a/product/synquacer/module/synquacer_pik_clock/src/mod_synquacer_pik_clock.c
+++ b/product/synquacer/module/synquacer_pik_clock/src/mod_synquacer_pik_clock.c
@@ -533,7 +533,7 @@ static const struct mod_clock_drv_api api_clock = {
* Direct driver API functions
*/
-#if BUILD_HAS_MOD_CSS_CLOCK
+#ifdef BUILD_HAS_MOD_CSS_CLOCK
static int pik_clock_direct_set_div(
fwk_id_t clock_id,
uint32_t divider_type,
@@ -718,7 +718,7 @@ static int pik_clock_process_bind_request(
ctx = module_ctx.dev_ctx_table + fwk_id_get_element_idx(target_id);
if (ctx->config->is_group_member) {
-#if BUILD_HAS_MOD_CSS_CLOCK
+#ifdef BUILD_HAS_MOD_CSS_CLOCK
/* Only the CSS Clock module can bind to group members. */
if (fwk_id_get_module_idx(source_id) == FWK_MODULE_IDX_CSS_CLOCK) {
*api = &api_direct;