diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 94ccdb8df235..d8664d5d1574 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -10905,8 +10905,8 @@ static int hdd_parse_vendor_acs_chan_config(struct hdd_vendor_chan_info nla_for_each_nested(curr_attr, tb[SET_CHAN_CHAN_LIST], rem) i++; - if (i > MAX_CHANNEL) { - hdd_err("Error: Exceeded max channels: %u", MAX_CHANNEL); + if (i > NUM_CHANNELS) { + hdd_err("Error: Exceeded max channels: %u", NUM_CHANNELS); return -ENOMEM; } diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 394a27de84ce..704578efff47 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -132,7 +132,6 @@ struct hdd_context; #define HDD_SET_BIT(__param, __val) ((__param) |= (1 << (__val))) -#define MAX_CHANNEL (NUM_24GHZ_CHANNELS + NUM_5GHZ_CHANNELS) #define MAX_SCAN_SSID 10 #define IS_CHANNEL_VALID(channel) ((channel >= 0 && channel < 15) \ diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 1aaf4f32babf..223aef2b1672 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -7255,7 +7255,7 @@ static int hdd_parse_disable_chan_cmd(struct hdd_adapter *adapter, uint8_t *ptr) struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); uint8_t *param; int j, i, temp_int, ret = 0, num_channels; - uint32_t parsed_channels[MAX_CHANNEL]; + uint32_t parsed_channels[NUM_CHANNELS]; bool is_command_repeated = false; if (!hdd_ctx) { @@ -7288,7 +7288,7 @@ static int hdd_parse_disable_chan_cmd(struct hdd_adapter *adapter, uint8_t *ptr) return -EINVAL; } - if (temp_int < 0 || temp_int > MAX_CHANNEL) { + if (temp_int < 0 || temp_int > NUM_CHANNELS) { hdd_err("Invalid Number of channel received"); return -EINVAL; } diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 0e4c66fadfea..d330509eea94 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -995,7 +995,7 @@ static int __wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy, n_channels += wiphy->bands[band]->n_channels; } - if (MAX_CHANNEL < n_channels) { + if (n_channels > NUM_CHANNELS) { hdd_err("Exceed max number of channels: %d", n_channels); return -EINVAL; } diff --git a/os_if/tdls/src/wlan_cfg80211_tdls.c b/os_if/tdls/src/wlan_cfg80211_tdls.c index f837a819b9c7..2e631cf2f815 100644 --- a/os_if/tdls/src/wlan_cfg80211_tdls.c +++ b/os_if/tdls/src/wlan_cfg80211_tdls.c @@ -35,8 +35,6 @@ #include #include "wlan_cfg80211_mc_cp_stats.h" -#define MAX_CHANNEL (NUM_24GHZ_CHANNELS + NUM_5GHZ_CHANNELS) - #define TDLS_MAX_NO_OF_2_4_CHANNELS 14 @@ -335,8 +333,8 @@ tdls_calc_channels_from_staparams(struct tdls_update_peer_params *req_info, for (i = 0; i < num_unique_channels; i++) osif_debug("[%d]: %d,", i, dest_chans[i]); - if (MAX_CHANNEL < num_unique_channels) - num_unique_channels = MAX_CHANNEL; + if (num_unique_channels > NUM_CHANNELS) + num_unique_channels = NUM_CHANNELS; req_info->supported_channels_len = num_unique_channels; osif_debug("After removing duplcates supported_channels_len: %d", req_info->supported_channels_len);