Quellcode durchsuchen

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
Dustin Brown vor 7 Jahren
Ursprung
Commit
26b3d04130
1 geänderte Dateien mit 13 neuen und 3 gelöschten Zeilen
  1. 13 3
      core/hdd/src/wlan_hdd_main.c

+ 13 - 3
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 <cdp_txrx_peer_ops.h>
 #include <cdp_txrx_misc.h>
 #include <cdp_txrx_stats.h>
@@ -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;