diff options
author | Chris Kay <chris.kay@arm.com> | 2020-07-29 22:47:19 +0100 |
---|---|---|
committer | jimqui01 <54316584+jimqui01@users.noreply.github.com> | 2020-08-28 16:48:19 +0100 |
commit | 22dccffbd8eb3885081ac702f316be826b58ea57 (patch) | |
tree | f91286552a023c4548c1d7129dcb7ce1f3ab8f46 /product/synquacer | |
parent | 0051b203027f58b942ccd5e8a43e74bcca6cdddd (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>
Diffstat (limited to 'product/synquacer')
-rw-r--r-- | product/synquacer/module/ppu_v0_synquacer/src/mod_ppu_v0.c | 10 | ||||
-rw-r--r-- | product/synquacer/module/synquacer_pik_clock/src/mod_synquacer_pik_clock.c | 4 |
2 files changed, 7 insertions, 7 deletions
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; |