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 /module/pik_clock | |
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 'module/pik_clock')
-rw-r--r-- | module/pik_clock/src/mod_pik_clock.c | 24 |
1 files changed, 12 insertions, 12 deletions
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; |