From 375cf9be91958b6c430b9362f35c62f3c08a4e0d Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Thu, 3 Sep 2020 15:17:12 -0700 Subject: [PATCH] qcacld-3.0: Remove logs for wlan_hdd_validate_context() checks wlan_hdd_validate_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. Change-Id: Ia1f4a1a413249e10c40d7644e9ffb314e991b237 CRs-Fixed: 2769591 --- core/hdd/src/wlan_hdd_cfg80211.c | 14 +++++--------- core/hdd/src/wlan_hdd_driver_ops.c | 16 ++++------------ core/hdd/src/wlan_hdd_hostapd.c | 4 +--- core/hdd/src/wlan_hdd_oemdata.c | 4 +--- core/hdd/src/wlan_hdd_p2p.c | 4 +--- core/hdd/src/wlan_hdd_tx_rx.c | 5 +---- 6 files changed, 13 insertions(+), 34 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index e5f12db07807..eeb698c3c563 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -23780,10 +23780,8 @@ static void wlan_hdd_chan_info_cb(struct scan_chan_info *info) uint8_t idx; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); - if (wlan_hdd_validate_context(hdd_ctx) != 0) { - hdd_err("hdd_ctx is invalid"); + if (wlan_hdd_validate_context(hdd_ctx) != 0) return; - } if (!hdd_ctx->chan_info) { hdd_err("chan_info is NULL"); @@ -23965,10 +23963,9 @@ static int __wlan_hdd_cfg80211_set_chainmask(struct wiphy *wiphy, enum hdd_chain_mode chains; ret = wlan_hdd_validate_context(hdd_ctx); - if (ret) { - hdd_err_rl("Invalid Hdd Context"); + if (ret) return -EINVAL; - } + if (hdd_ctx->num_rf_chains != HDD_ANTENNA_MODE_2X2 || !ucfg_mlme_is_chain_mask_supported(hdd_ctx->psoc)) { hdd_info_rl("Chainmask can't be configured, num of rf chain %d", @@ -24022,10 +24019,9 @@ static int __wlan_hdd_cfg80211_get_chainmask(struct wiphy *wiphy, int ret; ret = wlan_hdd_validate_context(hdd_ctx); - if (ret) { - hdd_err_rl("Invalid Hdd Context"); + if (ret) return -EINVAL; - } + *tx_mask = wma_cli_get_command(0, WMI_PDEV_PARAM_TX_CHAIN_MASK, PDEV_CMD); *rx_mask = wma_cli_get_command(0, WMI_PDEV_PARAM_RX_CHAIN_MASK, diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index e5e06e29f293..087cc256391d 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1076,10 +1076,8 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params) } err = wlan_hdd_validate_context(hdd_ctx); - if (err) { - hdd_err("Invalid hdd context: %d", err); + if (err) return err; - } hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); if (!hif_ctx) { @@ -1208,10 +1206,8 @@ int wlan_hdd_bus_suspend_noirq(void) } errno = wlan_hdd_validate_context(hdd_ctx); - if (errno) { - hdd_err("Invalid HDD context: errno %d", errno); + if (errno) return errno; - } hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); if (!hif_ctx) { @@ -1292,10 +1288,8 @@ int wlan_hdd_bus_resume(void) } status = wlan_hdd_validate_context(hdd_ctx); - if (status) { - hdd_err("Invalid hdd context"); + if (status) return status; - } hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); if (!hif_ctx) { @@ -1388,10 +1382,8 @@ int wlan_hdd_bus_resume_noirq(void) } status = wlan_hdd_validate_context(hdd_ctx); - if (status) { - hdd_err("Invalid HDD context: %d", status); + if (status) return status; - } hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); if (!hif_ctx) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index feb4532914f1..cfa86935ef51 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1078,10 +1078,8 @@ static void __wlan_hdd_sap_pre_cac_failure(struct hdd_adapter *adapter) hdd_enter(); hdd_ctx = WLAN_HDD_GET_CTX(adapter); - if (wlan_hdd_validate_context(hdd_ctx)) { - hdd_err("HDD context is null"); + if (wlan_hdd_validate_context(hdd_ctx)) return; - } wlan_hdd_release_intf_addr(hdd_ctx, adapter->mac_addr.bytes); hdd_stop_adapter(hdd_ctx, adapter); diff --git a/core/hdd/src/wlan_hdd_oemdata.c b/core/hdd/src/wlan_hdd_oemdata.c index 05c387301b07..8b4d9f59270d 100644 --- a/core/hdd/src/wlan_hdd_oemdata.c +++ b/core/hdd/src/wlan_hdd_oemdata.c @@ -978,10 +978,8 @@ static void oem_cmd_handler(const void *data, int data_len, void *ctx, int pid) struct nlattr *tb[CLD80211_ATTR_MAX + 1]; ret = wlan_hdd_validate_context(p_hdd_ctx); - if (ret) { - hdd_err("hdd ctx validate fails"); + if (ret) return; - } /* * audit note: it is ok to pass a NULL policy here since only diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 352747428c27..a79e93f6e09e 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -322,10 +322,8 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, return -EINVAL; ret = wlan_hdd_validate_context(hdd_ctx); - if (ret) { - hdd_err("wlan_hdd_validate_context return:%d", ret); + if (ret) return ret; - } type = WLAN_HDD_GET_TYPE_FRM_FC(buf[0]); sub_type = WLAN_HDD_GET_SUBTYPE_FRM_FC(buf[0]); diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 36d01598bcdb..eb6dcddf40e3 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -1010,11 +1010,8 @@ static void __hdd_hard_start_xmit(struct sk_buff *skb, } hdd_ctx = adapter->hdd_ctx; - if (wlan_hdd_validate_context(hdd_ctx)) { - QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_HDD_DATA, - "Invalid HDD context"); + if (wlan_hdd_validate_context(hdd_ctx)) goto drop_pkt; - } wlan_hdd_classify_pkt(skb); if (QDF_NBUF_CB_GET_PACKET_TYPE(skb) == QDF_NBUF_CB_PACKET_TYPE_ARP) {