From 26b3d0413068719d6781ddc54c331f551d8612e7 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Thu, 21 Dec 2017 11:13:27 -0800 Subject: [PATCH] qcacld-3.0: Fix runtime leak compilation issue HDD calls several qdf_debug_domain APIs when that feature is not enabled. Add conditional compilation to avoid these calls when runtime leak detection is not enabled. Change-Id: I78775c240b5352ed63f2e15f16e25159bbde5666 CRs-Fixed: 2162989 --- core/hdd/src/wlan_hdd_main.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 5baccee0a2c8..ca8d4779ec39 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -57,7 +57,9 @@ #include "wlan_hdd_request_manager.h" #include "qdf_types.h" #include "qdf_trace.h" +#ifdef CONFIG_LEAK_DETECTION #include "qdf_debug_domain.h" +#endif #include #include #include @@ -2348,6 +2350,7 @@ static void hdd_nan_register_callbacks(struct hdd_context *hdd_ctx) } #endif +#ifdef CONFIG_LEAK_DETECTION /** * hdd_check_for_leaks() - Perform runtime memory leak checks * @@ -2368,6 +2371,13 @@ static void hdd_check_for_leaks(void) qdf_mc_timer_check_for_leaks(); } +#define hdd_debug_domain_set(domain) qdf_debug_domain_set(domain) +#else +static inline void hdd_check_for_leaks(void) {} + +#define hdd_debug_domain_set(domain) +#endif /* CONFIG_LEAK_DETECTION */ + /** * hdd_wlan_start_modules() - Single driver state machine for starting modules * @hdd_ctx: HDD context @@ -2419,7 +2429,7 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, case DRIVER_MODULES_CLOSED: hdd_info("Wlan transitioning (CLOSED -> OPENED)"); - qdf_debug_domain_set(QDF_DEBUG_DOMAIN_ACTIVE); + hdd_debug_domain_set(QDF_DEBUG_DOMAIN_ACTIVE); if (!reinit && !unint) { ret = pld_power_on(qdf_dev->dev); @@ -2606,7 +2616,7 @@ release_lock: /* many adapter resources are not freed by design in SSR case */ if (!reinit) hdd_check_for_leaks(); - qdf_debug_domain_set(QDF_DEBUG_DOMAIN_INIT); + hdd_debug_domain_set(QDF_DEBUG_DOMAIN_INIT); EXIT(); @@ -10053,7 +10063,7 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) /* many adapter resources are not freed by design in SSR case */ if (!is_recovery_stop) hdd_check_for_leaks(); - qdf_debug_domain_set(QDF_DEBUG_DOMAIN_INIT); + hdd_debug_domain_set(QDF_DEBUG_DOMAIN_INIT); /* Once the firmware sequence is completed reset this flag */ hdd_ctx->imps_enabled = false;