From 89780bfc35efcad2587148e3d9a84c3d8b08dce5 Mon Sep 17 00:00:00 2001 From: Harprit Chhabada Date: Wed, 6 Mar 2019 14:01:38 -0800 Subject: [PATCH] qcacld-3.0: Clean up of external range validation for Boolean type BOOLEAN is native c type so external range validation is not needed. Cleanup references to cfg_in_range(), cfg_min and cfg_max for BOOLEAN items Change-Id: I4a60d1bbd12ad3cce00b33c551b3927b2f01f638 CRs-Fixed: 2359500 --- .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 5 -- core/hdd/src/wlan_hdd_ioctl.c | 47 ------------------- core/sme/src/common/sme_api.c | 6 +-- 3 files changed, 1 insertion(+), 57 deletions(-) diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index 2374aca5e210..2ae1328f617a 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -1361,11 +1361,6 @@ QDF_STATUS ucfg_mlme_set_ibss_auto_bssid(struct wlan_objmgr_psoc *psoc, mlme_err("MLME Obj null on get IBSS config"); return QDF_STATUS_E_INVAL; } - if (!cfg_in_range(CFG_IBSS_AUTO_BSSID, auto_bssid)) { - mlme_err("Invalid IBSS Auto BSSID control value: %d", - auto_bssid); - return QDF_STATUS_E_INVAL; - } mlme_obj->cfg.ibss.auto_bssid = auto_bssid; return QDF_STATUS_SUCCESS; } diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index a82a9bd8c712..8ee7158f27ed 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -3188,15 +3188,6 @@ static int drv_cmd_set_roam_mode(struct hdd_adapter *adapter, goto exit; } - if (!cfg_in_range(CFG_LFR_FEATURE_ENABLED, roam_mode)) { - hdd_err("Roam Mode value %d is out of range (Min: %d Max: %d)", - roam_mode, - cfg_min(CFG_LFR_FEATURE_ENABLED), - cfg_max(CFG_LFR_FEATURE_ENABLED)); - ret = -EINVAL; - goto exit; - } - hdd_debug("Received Command to Set Roam Mode = %d", roam_mode); /* @@ -3809,13 +3800,6 @@ static int drv_cmd_set_roam_intra_band(struct hdd_adapter *adapter, goto exit; } - if (!cfg_in_range(CFG_LFR_ROAM_INTRA_BAND, val)) { - hdd_err("intra band mode value %d is out of range (Min: %d Max: %d)", - val, cfg_min(CFG_LFR_ROAM_INTRA_BAND), - cfg_max(CFG_LFR_ROAM_INTRA_BAND)); - ret = -EINVAL; - goto exit; - } hdd_debug("Received Command to change intra band = %d", val); @@ -4027,14 +4011,6 @@ static int drv_cmd_set_wes_mode(struct hdd_adapter *adapter, goto exit; } - if (!cfg_in_range(CFG_LFR_ENABLE_WES_MODE, wes_mode)) { - hdd_err("WES Mode value %d is out of range (Min: %d Max: %d)", - wes_mode, cfg_min(CFG_LFR_ENABLE_WES_MODE), - cfg_max(CFG_LFR_ENABLE_WES_MODE)); - ret = -EINVAL; - goto exit; - } - hdd_debug("Received Command to Set WES Mode rssi diff = %d", wes_mode); sme_update_wes_mode(hdd_ctx->mac_handle, wes_mode, adapter->vdev_id); @@ -4207,14 +4183,6 @@ static int drv_cmd_set_fast_roam(struct hdd_adapter *adapter, goto exit; } - if (!cfg_in_range(CFG_LFR_FEATURE_ENABLED, lfr_mode)) { - hdd_err("lfr mode value %d is out of range (Min: %d Max: %d)", - lfr_mode, cfg_min(CFG_LFR_FEATURE_ENABLED), - cfg_max(CFG_LFR_FEATURE_ENABLED)); - ret = -EINVAL; - goto exit; - } - hdd_debug("Received Command to change lfr mode = %d", lfr_mode); @@ -4254,14 +4222,6 @@ static int drv_cmd_set_fast_transition(struct hdd_adapter *adapter, goto exit; } - if (!cfg_in_range(CFG_LFR_FAST_TRANSITION_ENABLED, ft)) { - hdd_err("ft mode value %d is out of range (Min: %d Max: %d)", - ft, cfg_min(CFG_LFR_FAST_TRANSITION_ENABLED), - cfg_max(CFG_LFR_FAST_TRANSITION_ENABLED)); - ret = -EINVAL; - goto exit; - } - hdd_debug("Received Command to change ft mode = %d", ft); ucfg_mlme_set_fast_transition_enabled(hdd_ctx->psoc, (bool)ft); @@ -5720,13 +5680,6 @@ static int drv_cmd_set_ccx_mode(struct hdd_adapter *adapter, goto exit; } - if (!cfg_in_range(CFG_LFR_ESE_FEATURE_ENABLED, ese_mode)) { - hdd_err("Ese mode value %d is out of range (Min: %d Max: %d)", - ese_mode, cfg_min(CFG_LFR_ESE_FEATURE_ENABLED), - cfg_max(CFG_LFR_ESE_FEATURE_ENABLED)); - ret = -EINVAL; - goto exit; - } hdd_debug("Received Command to change ese mode = %d", ese_mode); sme_update_is_ese_feature_enabled(mac_handle, diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 55a4889f5603..3fa49f3eebe4 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -11382,11 +11382,7 @@ int sme_update_he_om_ctrl_supp(mac_handle_t mac_handle, uint8_t session_id, sme_err("No session for id %d", session_id); return -EINVAL; } - if (cfg_in_range(CFG_HE_OMI, cfg_val)) - mac_ctx->mlme_cfg->he_caps.dot11_he_cap.omi_a_ctrl = - cfg_val; - else - return -EINVAL; + mac_ctx->mlme_cfg->he_caps.dot11_he_cap.omi_a_ctrl = cfg_val; csr_update_session_he_cap(mac_ctx, session); return 0;