Просмотр исходного кода

qcacld-3.0: hdd: Remove logs for cds_get_context() checks

cds_get_context() function already takes care of logging the
caller function name in case of any error.
Hence there is no need to add the error log again.

Getting rid of these unnecessary logs reduces driver memory footprint.

CRs-Fixed: 2813747
Change-Id: I025b5882f86b0b9f52e5ac903b873c06c458d07c
Srinivas Girigowda 4 лет назад
Родитель
Сommit
12294bf4af

+ 3 - 6
core/hdd/src/wlan_hdd_assoc.c

@@ -2109,10 +2109,9 @@ static void hdd_set_peer_authorized_event(uint32_t vdev_id)
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	struct hdd_adapter *adapter = NULL;
 
-	if (!hdd_ctx) {
-		hdd_err("Invalid hdd context");
+	if (!hdd_ctx)
 		return;
-	}
+
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	if (!adapter) {
 		hdd_err("Invalid vdev_id");
@@ -2203,10 +2202,8 @@ QDF_STATUS hdd_update_dp_vdev_flags(void *cbk_data,
 	psoc = cbk_data;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("Invalid HDD Context");
+	if (!hdd_ctx)
 		return QDF_STATUS_E_INVAL;
-	}
 
 	if (!hdd_ctx->tdls_nap_active)
 		return status;

+ 5 - 12
core/hdd/src/wlan_hdd_cfg80211.c

@@ -8384,10 +8384,8 @@ static void hdd_set_wlm_host_latency_level(struct hdd_context *hdd_ctx,
 {
 	ol_txrx_soc_handle soc_hdl = cds_get_context(QDF_MODULE_ID_SOC);
 
-	if (!soc_hdl) {
-		hdd_err("txrx soc handle NULL");
+	if (!soc_hdl)
 		return;
-	}
 
 	if (latency_host_flags & WLM_HOST_PM_QOS_FLAG)
 		hdd_ctx->pm_qos_request_flags |= (1 << adapter->vdev_id);
@@ -12091,10 +12089,9 @@ __wlan_hdd_cfg80211_avoid_freq(struct wiphy *wiphy,
 
 	hdd_enter_dev(wdev->netdev);
 
-	if (!qdf_ctx) {
-		hdd_err("qdf_ctx is NULL");
+	if (!qdf_ctx)
 		return -EINVAL;
-	}
+
 	curr_mode = hdd_get_conparam();
 	if (QDF_GLOBAL_FTM_MODE == curr_mode ||
 	    QDF_GLOBAL_MONITOR_MODE == curr_mode) {
@@ -14927,10 +14924,8 @@ int wlan_hdd_send_mode_change_event(void)
 
 	hdd_enter();
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	err = wlan_hdd_validate_context(hdd_ctx);
 	if (0 != err)
@@ -18450,10 +18445,8 @@ bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter,
 	uint32_t ch_freq = 0;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return true;
-	}
 
 	ap_adapter = hdd_get_adapter(hdd_ctx, QDF_SAP_MODE);
 	/* probably no sap running, no handling required */

+ 18 - 51
core/hdd/src/wlan_hdd_driver_ops.c

@@ -342,10 +342,8 @@ int hdd_hif_open(struct device *dev, void *bdev, const struct hif_bus_id *bid,
 	uint32_t mode = cds_get_conparam();
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx error");
+	if (!hdd_ctx)
 		return -EFAULT;
-	}
 
 	hdd_hif_init_driver_state_callbacks(dev, &cbk);
 
@@ -451,10 +449,8 @@ static int hdd_init_qdf_ctx(struct device *dev, void *bdev,
 {
 	qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
 
-	if (!qdf_dev) {
-		hdd_err("Invalid QDF device");
+	if (!qdf_dev)
 		return -EINVAL;
-	}
 
 	qdf_dev->dev = dev;
 	qdf_dev->drv_hdl = bdev;
@@ -878,10 +874,8 @@ static void hdd_soc_recovery_cleanup(void)
 	struct hdd_context *hdd_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is null");
+	if (!hdd_ctx)
 		return;
-	}
 
 	/* cancel/flush any pending/active idle shutdown work */
 	hdd_psoc_idle_timer_stop(hdd_ctx);
@@ -911,10 +905,8 @@ static void __hdd_soc_recovery_shutdown(void)
 	hdd_init_start_completion();
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is null");
+	if (!hdd_ctx)
 		return;
-	}
 
 	/*
 	 * Perform SSR related cleanup if it has not already been done as a
@@ -929,10 +921,8 @@ static void __hdd_soc_recovery_shutdown(void)
 		hdd_err("Debufs threads are still pending, attempting SSR anyway");
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_ctx) {
-		hdd_err("Failed to get HIF context, ignore SSR shutdown");
+	if (!hif_ctx)
 		return;
-	}
 
 	/* mask the host controller interrupts */
 	hif_mask_interrupt_call(hif_ctx);
@@ -992,10 +982,8 @@ static void wlan_hdd_crash_shutdown(void)
 	QDF_STATUS ret;
 	WMA_HANDLE wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
 
-	if (!wma_handle) {
-		hdd_err("wma_handle is null");
+	if (!wma_handle)
 		return;
-	}
 
 	/*
 	 * When kernel panic happen, if WiFi FW is still active
@@ -1130,10 +1118,8 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params)
 	hdd_info("starting bus suspend");
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err_rl("hdd context is NULL");
+	if (!hdd_ctx)
 		return -ENODEV;
-	}
 
 	/* If Wifi is off, return success for system suspend */
 	if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
@@ -1146,10 +1132,8 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params)
 		return err;
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_ctx) {
-		hdd_err("Failed to get hif context");
+	if (!hif_ctx)
 		return -EINVAL;
-	}
 
 	err = hdd_to_pmo_wow_enable_params(&wow_params, &pmo_params);
 	if (err) {
@@ -1260,10 +1244,8 @@ int wlan_hdd_bus_suspend_noirq(void)
 
 	hdd_debug("start bus_suspend_noirq");
 
-	if (!hdd_ctx) {
-		hdd_err_rl("hdd context is NULL");
+	if (!hdd_ctx)
 		return -ENODEV;
-	}
 
 	/* If Wifi is off, return success for system suspend */
 	if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
@@ -1276,10 +1258,8 @@ int wlan_hdd_bus_suspend_noirq(void)
 		return errno;
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_ctx) {
-		hdd_err("hif_ctx is null");
+	if (!hif_ctx)
 		return -EINVAL;
-	}
 
 	errno = hif_bus_suspend_noirq(hif_ctx);
 	if (errno)
@@ -1342,10 +1322,8 @@ int wlan_hdd_bus_resume(void)
 
 	hdd_info("starting bus resume");
 
-	if (!hdd_ctx) {
-		hdd_err_rl("hdd context is NULL");
+	if (!hdd_ctx)
 		return -ENODEV;
-	}
 
 	/* If Wifi is off, return success for system resume */
 	if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
@@ -1358,10 +1336,8 @@ int wlan_hdd_bus_resume(void)
 		return status;
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_ctx) {
-		hdd_err("Failed to get hif context");
+	if (!hif_ctx)
 		return -EINVAL;
-	}
 
 	/*
 	 * Add bus votes at the beginning, before making sure there are any
@@ -1436,10 +1412,8 @@ int wlan_hdd_bus_resume_noirq(void)
 	if (cds_is_driver_recovering())
 		return 0;
 
-	if (!hdd_ctx) {
-		hdd_err_rl("hdd context is NULL");
+	if (!hdd_ctx)
 		return -ENODEV;
-	}
 
 	/* If Wifi is off, return success for system resume */
 	if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
@@ -1479,10 +1453,8 @@ static int wlan_hdd_bus_reset_resume(void)
 {
 	struct hif_opaque_softc *scn = cds_get_context(QDF_MODULE_ID_HIF);
 
-	if (!scn) {
-		hdd_err("Failed to get HIF context");
+	if (!scn)
 		return -EFAULT;
-	}
 
 	return hif_bus_reset_resume(scn);
 }
@@ -1497,10 +1469,8 @@ static int hdd_pld_runtime_suspend_cb(void)
 {
 	qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
 
-	if (!qdf_dev) {
-		hdd_err("Invalid context");
+	if (!qdf_dev)
 		return -EINVAL;
-	}
 
 	return pld_auto_suspend(qdf_dev->dev);
 }
@@ -1570,10 +1540,8 @@ static int hdd_pld_runtime_resume_cb(void)
 {
 	qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
 
-	if (!qdf_dev) {
-		hdd_err("Invalid context");
+	if (!qdf_dev)
 		return -EINVAL;
-	}
 
 	return pld_auto_resume(qdf_dev->dev);
 }
@@ -1602,10 +1570,9 @@ static int wlan_hdd_runtime_resume(struct device *dev)
 	 * resume fail, if driver load/unload in-progress, so not doing
 	 * wlan_hdd_validate_context, have only SSR in progress check.
 	 */
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is NULL");
+	if (!hdd_ctx)
 		return 0;
-	}
+
 	if (cds_is_driver_recovering()) {
 		hdd_debug("Recovery in progress, state:0x%x",
 			  cds_get_driver_state());

+ 3 - 9
core/hdd/src/wlan_hdd_ipa.c

@@ -57,16 +57,12 @@ void hdd_ipa_set_tx_flow_info(void)
 	struct wlan_objmgr_psoc *psoc;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return;
-	}
 
 	cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
-	if (!cds_ctx) {
-		hdd_err("Invalid CDS Context");
+	if (!cds_ctx)
 		return;
-	}
 
 	psoc = hdd_ctx->psoc;
 
@@ -516,10 +512,8 @@ void hdd_ipa_set_mcc_mode(bool mcc_mode)
 	struct hdd_context *hdd_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return;
-	}
 
 	ucfg_ipa_set_mcc_mode(hdd_ctx->pdev, mcc_mode);
 }

+ 1 - 3
core/hdd/src/wlan_hdd_lro.c

@@ -49,10 +49,8 @@ static qdf_lro_ctx_t wlan_hdd_get_lro_ctx(struct sk_buff *skb)
 {
 	struct hif_opaque_softc *hif_hdl =
 		(struct hif_opaque_softc *)cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_hdl) {
-		hdd_err("hif_hdl is NULL");
+	if (!hif_hdl)
 		return NULL;
-	}
 
 	return hif_get_lro_info(QDF_NBUF_CB_RX_CTX_ID(skb), hif_hdl);
 }

+ 30 - 90
core/hdd/src/wlan_hdd_main.c

@@ -838,10 +838,9 @@ void wlan_hdd_txrx_pause_cb(uint8_t vdev_id,
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	struct hdd_adapter *adapter;
 
-	if (!hdd_ctx) {
-		hdd_err("hdd ctx is NULL");
+	if (!hdd_ctx)
 		return;
-	}
+
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	wlan_hdd_mod_fc_timer(adapter, action);
 	wlan_hdd_netif_queue_control(adapter, action, reason);
@@ -959,10 +958,8 @@ static int __hdd_netdev_notifier_call(struct net_device *net_dev,
 	}
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD Context is Null");
+	if (!hdd_ctx)
 		return NOTIFY_DONE;
-	}
 
 	if (hdd_ctx->driver_status == DRIVER_MODULES_CLOSED) {
 		hdd_debug("Driver module is closed");
@@ -2963,10 +2960,8 @@ wlan_hdd_update_dbs_scan_and_fw_mode_config(void)
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	uint8_t dual_mac_feature = DISABLE_DBS_CXN_AND_SCAN;
 
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return QDF_STATUS_E_FAILURE;
-	}
 
 	/*
 	 * ROME platform doesn't support any DBS related commands in FW,
@@ -3114,10 +3109,8 @@ void hdd_update_hw_sw_info(struct hdd_context *hdd_ctx)
 	uint32_t buf_len;
 
 	hif_sc = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_sc) {
-		hdd_err("HIF context is NULL");
+	if (!hif_sc)
 		return;
-	}
 
 	hif_get_hw_info(hif_sc, &hdd_ctx->target_hw_version,
 			&hdd_ctx->target_hw_revision,
@@ -3164,11 +3157,8 @@ hdd_update_cds_ac_specs_params(struct hdd_context *hdd_ctx)
 	}
 
 	cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
-
-	if (!cds_ctx) {
-		hdd_err("Invalid CDS Context");
+	if (!cds_ctx)
 		return;
-	}
 
 	for (i = 0; i < QCA_WLAN_AC_ALL; i++) {
 		switch (i) {
@@ -3743,10 +3733,8 @@ static void hdd_enable_power_management(struct hdd_context *hdd_ctx)
 {
 	void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
 
-	if (!hif_ctx) {
-		hdd_err("Bus Interface Context is Invalid");
+	if (!hif_ctx)
 		return;
-	}
 
 	hif_enable_power_management(hif_ctx, cds_is_packet_log_enabled());
 	hdd_wlan_register_pm_qos_notifier(hdd_ctx);
@@ -3763,10 +3751,8 @@ static void hdd_disable_power_management(struct hdd_context *hdd_ctx)
 {
 	void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
 
-	if (!hif_ctx) {
-		hdd_err("Bus Interface Context is Invalid");
+	if (!hif_ctx)
 		return;
-	}
 
 	hdd_wlan_unregister_pm_qos_notifier(hdd_ctx);
 	hif_disable_power_management(hif_ctx);
@@ -3844,7 +3830,6 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit)
 	hdd_enter();
 	qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
 	if (!qdf_dev) {
-		hdd_err("QDF Device Context is Invalid return");
 		hdd_exit();
 		return -EINVAL;
 	}
@@ -3891,7 +3876,6 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit)
 
 		hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
 		if (!hif_ctx) {
-			hdd_err("hif context is null!!");
 			ret = -EINVAL;
 			goto power_down;
 		}
@@ -4947,10 +4931,8 @@ static int __hdd_set_features(struct net_device *net_dev,
 		return 0;
 	}
 
-	if (!soc) {
-		hdd_err("soc handle is NULL");
+	if (!soc)
 		return 0;
-	}
 
 	hdd_debug("vdev mode %d vdev_id %d current features 0x%llx, changed features 0x%llx",
 		  adapter->device_mode, adapter->vdev_id, net_dev->features,
@@ -5000,10 +4982,8 @@ void hdd_netdev_update_features(struct hdd_adapter *adapter)
 	ol_txrx_soc_handle soc = cds_get_context(QDF_MODULE_ID_SOC);
 	bool request_feature_update = false;
 
-	if (!soc) {
-		hdd_err("soc handle is NULL");
+	if (!soc)
 		return;
-	}
 
 	if (!cdp_cfg_get(soc, cfg_dp_disable_legacy_mode_csum_offload))
 		return;
@@ -5261,10 +5241,8 @@ QDF_STATUS hdd_sme_close_session_callback(uint8_t vdev_id)
 	struct hdd_context *hdd_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("Invalid HDD_CTX");
+	if (!hdd_ctx)
 		return QDF_STATUS_E_FAILURE;
-	}
 
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	if (!adapter) {
@@ -8445,10 +8423,8 @@ QDF_STATUS hdd_adapter_iterate(hdd_adapter_iterate_cb cb, void *context)
 	int i;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (unlikely(!hdd_ctx)) {
-		hdd_err("HDD context is Null");
+	if (unlikely(!hdd_ctx))
 		return QDF_STATUS_E_FAILURE;
-	}
 
 	qdf_spin_lock_bh(&hdd_ctx->hdd_adapter_lock);
 	for (hdd_get_front_adapter_no_lock(hdd_ctx, &adapter); adapter;
@@ -8611,10 +8587,8 @@ enum QDF_OPMODE hdd_get_device_mode(uint32_t vdev_id)
 	struct hdd_adapter *adapter;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("Invalid HDD context");
+	if (!hdd_ctx)
 		return QDF_MAX_NO_OF_MODE;
-	}
 
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	if (!adapter) {
@@ -9307,10 +9281,8 @@ static void hdd_display_periodic_stats(struct hdd_context *hdd_ctx,
 		return;
 
 	soc = cds_get_context(QDF_MODULE_ID_SOC);
-	if (!soc) {
-		hdd_err("soc is NULL");
+	if (!soc)
 		return;
-	}
 
 	counter++;
 	if (data_in_interval)
@@ -10260,10 +10232,8 @@ static void hdd_adapter_param_update_work(void *arg)
 	struct osif_vdev_sync *vdev_sync;
 	int errno;
 
-	if (!hdd_ctx) {
-		hdd_err("Invalid hdd context");
+	if (!hdd_ctx)
 		return;
-	}
 
 	hdd_adapter_ops_record_event(hdd_ctx,
 				     WLAN_HDD_ADAPTER_OPS_WORK_SCHED,
@@ -11724,10 +11694,8 @@ int hdd_psoc_idle_shutdown(struct device *dev)
 	int ret;
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 
-	if (!hdd_ctx) {
-		hdd_err_rl("hdd ctx is null");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	if (is_mode_change_psoc_idle_shutdown)
 		ret = __hdd_mode_change_psoc_idle_shutdown(hdd_ctx);
@@ -11756,10 +11724,8 @@ int hdd_psoc_idle_restart(struct device *dev)
 {
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 
-	if (!hdd_ctx) {
-		hdd_err_rl("hdd ctx is null");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	return __hdd_psoc_idle_restart(hdd_ctx);
 }
@@ -13956,10 +13922,8 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode)
 
 	hdd_enter();
 	qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
-	if (!qdf_ctx) {
-		hdd_err("QDF device context NULL");
+	if (!qdf_ctx)
 		return -EINVAL;
-	}
 
 	cds_set_module_stop_in_progress(true);
 
@@ -14083,10 +14047,8 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode)
 
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_ctx) {
-		hdd_err("Hif context is Null");
+	if (!hif_ctx)
 		ret = -EINVAL;
-	}
 
 	if (hdd_ctx->target_hw_name) {
 		qdf_mem_free(hdd_ctx->target_hw_name);
@@ -14165,10 +14127,8 @@ static void hdd_state_info_dump(char **buf_ptr, uint16_t *size)
 	char *buf = *buf_ptr;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("Failed to get hdd context ");
+	if (!hdd_ctx)
 		return;
-	}
 
 	hdd_debug("size of buffer: %d", *size);
 
@@ -14633,10 +14593,8 @@ int hdd_wlan_startup(struct hdd_context *hdd_ctx)
 	wlan_hdd_update_wiphy(hdd_ctx);
 
 	hdd_ctx->mac_handle = cds_get_context(QDF_MODULE_ID_SME);
-	if (!hdd_ctx->mac_handle) {
-		hdd_err("Mac Handle is null");
+	if (!hdd_ctx->mac_handle)
 		goto stop_modules;
-	}
 
 	errno = hdd_wiphy_init(hdd_ctx);
 	if (errno) {
@@ -15802,10 +15760,8 @@ static void hdd_inform_wifi_off(void)
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	struct osif_psoc_sync *psoc_sync;
 
-	if (!hdd_ctx) {
-		hdd_err("HDD context is Null");
+	if (!hdd_ctx)
 		return;
-	}
 
 	ret = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy), &psoc_sync);
 	if (ret)
@@ -17699,10 +17655,8 @@ static QDF_STATUS hdd_is_connection_in_progress_iterator(
 	struct hdd_is_connection_in_progress_priv *context = ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return QDF_STATUS_E_ABORTED;
-	}
 
 	mac_handle = hdd_ctx->mac_handle;
 
@@ -17927,16 +17881,12 @@ void hdd_check_and_restart_sap_with_non_dfs_acs(void)
 	uint32_t restart_freq;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return;
-	}
 
 	cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
-	if (!cds_ctx) {
-		hdd_err("Invalid CDS Context");
+	if (!cds_ctx)
 		return;
-	}
 
 	if (policy_mgr_get_concurrency_mode(hdd_ctx->psoc)
 		!= (QDF_STA_MASK | QDF_SAP_MASK)) {
@@ -17986,10 +17936,8 @@ bool hdd_set_connection_in_progress(bool value)
 	struct hdd_context *hdd_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return false;
-	}
 
 	qdf_spin_lock(&hdd_ctx->connection_status_lock);
 	/*
@@ -18166,10 +18114,8 @@ bool wlan_hdd_is_session_type_monitor(uint8_t session_type)
 {
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 
-	if (!hdd_ctx) {
-		cds_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return false;
-	}
 
 	if (ucfg_pkt_capture_get_mode(hdd_ctx->psoc) &&
 	    cds_get_conparam() != QDF_GLOBAL_MONITOR_MODE &&
@@ -18191,10 +18137,8 @@ bool wlan_hdd_check_mon_concurrency(void)
 {
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 
-	if (!hdd_ctx) {
-		hdd_err("HDD context is null");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	if (ucfg_pkt_capture_get_mode(hdd_ctx->psoc)) {
 		if (policy_mgr_get_concurrency_mode(hdd_ctx->psoc) ==
@@ -18356,10 +18300,8 @@ void hdd_sme_monitor_mode_callback(uint8_t vdev_id)
 	struct hdd_context *hdd_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err_rl("Invalid HDD_CTX");
+	if (!hdd_ctx)
 		return;
-	}
 
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	if (!adapter) {
@@ -18431,10 +18373,8 @@ void hdd_beacon_latency_event_cb(uint32_t latency_level)
 	struct hdd_context *hdd_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err_rl("Invalid HDD_CTX");
+	if (!hdd_ctx)
 		return;
-	}
 
 	if (latency_level ==
 		QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_ULTRALOW)

+ 2 - 6
core/hdd/src/wlan_hdd_memdump.c

@@ -64,10 +64,8 @@ void hdd_driver_mem_cleanup(void)
 	struct hdd_context *hdd_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("Invalid HDD context");
+	if (!hdd_ctx)
 		return;
-	}
 
 	if (hdd_ctx->driver_dump_mem) {
 		qdf_mem_free(hdd_ctx->driver_dump_mem);
@@ -282,10 +280,8 @@ int hdd_driver_memdump_init(void)
 	struct hdd_context *hdd_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("Invalid HDD context");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	mutex_init(&hdd_ctx->memdump_lock);
 

+ 8 - 24
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -571,10 +571,8 @@ int hdd_ndi_open(char *iface_name)
 	uint8_t *ndi_mac_addr;
 
 	hdd_enter();
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx null");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter) {
 		if (WLAN_HDD_IS_NDI(adapter))
@@ -624,10 +622,8 @@ int hdd_ndi_start(char *iface_name, uint16_t transaction_id)
 	struct wlan_objmgr_vdev *vdev;
 
 	hdd_enter();
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is null");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	adapter = hdd_get_adapter_by_iface_name(hdd_ctx, iface_name);
 	if (!adapter) {
@@ -697,10 +693,8 @@ int hdd_ndi_delete(uint8_t vdev_id, char *iface_name, uint16_t transaction_id)
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	struct wlan_objmgr_vdev *vdev;
 
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is null");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	/* check if adapter by vdev_id is valid NDI */
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
@@ -748,10 +742,8 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
 	struct wlan_objmgr_vdev *vdev;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is null");
+	if (!hdd_ctx)
 		return;
-	}
 
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	if (!adapter) {
@@ -819,10 +811,8 @@ void hdd_ndi_close(uint8_t vdev_id)
 	struct hdd_adapter *adapter;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is null");
+	if (!hdd_ctx)
 		return;
-	}
 
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	if (!adapter) {
@@ -841,10 +831,8 @@ void hdd_ndi_drv_ndi_delete_rsp_handler(uint8_t vdev_id)
 	struct qdf_mac_addr bc_mac_addr = QDF_MAC_ADDR_BCAST_INIT;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is null");
+	if (!hdd_ctx)
 		return;
-	}
 
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	if (!adapter) {
@@ -905,10 +893,8 @@ int hdd_ndp_new_peer_handler(uint8_t vdev_id, uint16_t sta_id,
 	struct csr_roam_info *roam_info;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is null");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	if (!adapter) {
@@ -989,10 +975,8 @@ void hdd_ndp_peer_departed_handler(uint8_t vdev_id, uint16_t sta_id,
 	struct hdd_station_ctx *sta_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is null");
+	if (!hdd_ctx)
 		return;
-	}
 
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	if (!adapter) {

+ 0 - 1
core/hdd/src/wlan_hdd_napi.c

@@ -289,7 +289,6 @@ static int hdd_napi_perfd_cpufreq(enum qca_napi_tput_state req_state)
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 	if (unlikely(!hdd_ctx)) {
-		hdd_err("cannot get hdd_context");
 		rc = -EFAULT;
 		goto hnpc_ret;
 	}

+ 1 - 3
core/hdd/src/wlan_hdd_object_manager.c

@@ -59,10 +59,8 @@ static void hdd_init_psoc_qdf_ctx(struct wlan_objmgr_psoc *psoc)
 	qdf_device_t qdf_ctx;
 
 	qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
-	if (!qdf_ctx) {
-		hdd_err("qdf ctx is null, can't set to soc object");
+	if (!qdf_ctx)
 		return;
-	}
 
 	wlan_psoc_set_qdf_dev(psoc, qdf_ctx);
 }

+ 11 - 31
core/hdd/src/wlan_hdd_power.c

@@ -1047,10 +1047,8 @@ int wlan_hdd_pm_qos_notify(struct notifier_block *nb, unsigned long curr_val,
 	}
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_ctx) {
-		hdd_err("Hif context is Null");
+	if (!hif_ctx)
 		return -EINVAL;
-	}
 
 	hdd_debug("PM QOS update: runtime_pm_prevented %d Current value: %ld",
 		  hdd_ctx->runtime_pm_prevented, curr_val);
@@ -1309,10 +1307,8 @@ hdd_suspend_wlan(void)
 	hdd_info("WLAN being suspended by OS");
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is Null");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	if (cds_is_driver_recovering() || cds_is_driver_in_bad_state()) {
 		hdd_info("Recovery in Progress. State: 0x%x Ignore suspend!!!",
@@ -1370,10 +1366,8 @@ static int hdd_resume_wlan(void)
 	hdd_info("WLAN being resumed by OS");
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is Null");
+	if (!hdd_ctx)
 		return -EINVAL;
-	}
 
 	if (cds_is_driver_recovering() || cds_is_driver_in_bad_state()) {
 		hdd_info("Recovery in Progress. State: 0x%x Ignore resume!!!",
@@ -1465,10 +1459,8 @@ QDF_STATUS hdd_wlan_shutdown(void)
 
 	/* Get the HDD context. */
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is Null");
+	if (!hdd_ctx)
 		return QDF_STATUS_E_FAILURE;
-	}
 
 	hdd_set_connection_in_progress(false);
 	policy_mgr_clear_concurrent_session_count(hdd_ctx->psoc);
@@ -1646,10 +1638,9 @@ QDF_STATUS hdd_wlan_re_init(void)
 
 	/* Get the HDD context */
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is Null");
+	if (!hdd_ctx)
 		goto err_ctx_null;
-	}
+
 	bug_on_reinit_failure = hdd_ctx->config->bug_on_reinit_failure;
 
 	adapter = hdd_get_first_valid_adapter(hdd_ctx);
@@ -1982,10 +1973,8 @@ static void hdd_suspend_cb(void)
 	struct hdd_context *hdd_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return;
-	}
 
 	complete(&hdd_ctx->mc_sus_event_var);
 }
@@ -2809,16 +2798,13 @@ static void __hdd_wlan_fake_apps_resume(struct wiphy *wiphy,
 
 	qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
 	if (!qdf_dev) {
-		hdd_err("Failed to get QDF device context");
 		QDF_BUG(0);
 		return;
 	}
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_ctx) {
-		hdd_err("Failed to get HIF context");
+	if (!hif_ctx)
 		return;
-	}
 
 	if (!test_and_clear_bit(HDD_FA_SUSPENDED_BIT, &fake_apps_state)) {
 		hdd_alert("Not unit-test suspended; Nothing to do");
@@ -2903,16 +2889,12 @@ int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy, struct net_device *dev,
 	}
 
 	qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
-	if (!qdf_dev) {
-		hdd_err("Failed to get QDF device context");
+	if (!qdf_dev)
 		return -EINVAL;
-	}
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_ctx) {
-		hdd_err("Failed to get HIF context");
+	if (!hif_ctx)
 		return -EINVAL;
-	}
 
 	if (test_and_set_bit(HDD_FA_SUSPENDED_BIT, &fake_apps_state)) {
 		hdd_alert("Already unit-test suspended; Nothing to do");
@@ -2996,10 +2978,8 @@ int hdd_wlan_fake_apps_resume(struct wiphy *wiphy, struct net_device *dev)
 	}
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (!hif_ctx) {
-		hdd_err("Failed to get HIF context");
+	if (!hif_ctx)
 		return -EINVAL;
-	}
 
 	hif_ut_apps_resume(hif_ctx);
 	__hdd_wlan_fake_apps_resume(wiphy, dev);

+ 1 - 3
core/hdd/src/wlan_hdd_stats.c

@@ -4898,10 +4898,8 @@ bool hdd_report_max_rate(struct hdd_adapter *adapter,
 	struct wlan_objmgr_vdev *vdev;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("HDD context is NULL");
+	if (!hdd_ctx)
 		return false;
-	}
 
 	ucfg_mlme_stats_get_cfg_values(hdd_ctx->psoc,
 				       &link_speed_rssi_high,

+ 1 - 3
core/hdd/src/wlan_hdd_sysfs.c

@@ -386,10 +386,8 @@ static ssize_t __show_beacon_reception_stats(struct net_device *net_dev,
 	QDF_STATUS status;
 
 	ret_val = wlan_hdd_validate_context(hdd_ctx);
-	if (ret_val) {
-		hdd_err("hdd ctx is invalid");
+	if (ret_val)
 		return ret_val;
-	}
 
 	if (!adapter || adapter->magic != WLAN_HDD_ADAPTER_MAGIC) {
 		hdd_err("Invalid adapter or adapter has invalid magic");

+ 1 - 3
core/hdd/src/wlan_hdd_sysfs_txrx_stats.c

@@ -88,10 +88,8 @@ __hdd_sysfs_txrx_stats_store(struct net_device *net_dev,
 
 	hdd_debug("WE_SET_TXRX_STATS stats cmd: %d mac_id: %d",
 		  req.stats, req.mac_id);
-	if (qdf_unlikely(!soc)) {
-		hdd_err("soc is NULL");
+	if (qdf_unlikely(!soc))
 		return -EINVAL;
-	}
 
 	if (val1 == CDP_TXRX_STATS_28) {
 		if (sta_ctx->conn_info.is_authenticated) {

+ 2 - 7
core/hdd/src/wlan_hdd_tx_rx.c

@@ -1982,10 +1982,8 @@ void hdd_disable_rx_ol_in_concurrency(bool disable)
 {
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 
-	if (!hdd_ctx) {
-		hdd_err("hdd_ctx is NULL");
+	if (!hdd_ctx)
 		return;
-	}
 
 	if (disable) {
 		if (HDD_MSM_CFG(hdd_ctx->config->enable_tcp_delack)) {
@@ -2370,11 +2368,8 @@ QDF_STATUS hdd_rx_flush_packet_cbk(void *adapter_context, uint8_t vdev_id)
 		return QDF_STATUS_E_FAILURE;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (unlikely(!hdd_ctx)) {
-		QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
-			  "%s: HDD context is Null", __func__);
+	if (unlikely(!hdd_ctx))
 		return QDF_STATUS_E_FAILURE;
-	}
 
 	adapter = hdd_adapter_get_by_reference(hdd_ctx, adapter_context);
 	if (!adapter) {

+ 3 - 6
core/hdd/src/wlan_hdd_wext.c

@@ -6309,10 +6309,8 @@ static int __iw_get_char_setnone(struct net_device *dev,
 		enum qca_wlan_ac_type duration[QCA_WLAN_AC_ALL];
 		void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
-		if (!soc) {
-			hdd_err("Invalid SOC handle");
+		if (!soc)
 			break;
-		}
 
 		for (i = 0; i < QCA_WLAN_AC_ALL; i++)
 			cdp_get_ba_timeout(soc, i, &duration[i]);
@@ -8950,10 +8948,9 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
 	{
 		void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
-		if (!soc) {
-			hdd_err("Invalid handles");
+		if (!soc)
 			break;
-		}
+
 		cdp_set_ba_timeout(soc, value[1], value[2]);
 		break;
 	}

+ 1 - 3
core/hdd/src/wlan_hdd_wmm.c

@@ -2432,10 +2432,8 @@ bool hdd_wmm_is_acm_allowed(uint8_t vdev_id)
 	struct hdd_context *hdd_ctx;
 
 	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx) {
-		hdd_err("Unable to fetch the hdd context");
+	if (!hdd_ctx)
 		return false;
-	}
 
 	adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
 	if (hdd_validate_adapter(adapter))