qcacld-3.0: Fix static code analysis issues in different API
Change 1. In the API hdd_get_roam_chan_from_fw Changed the return type form static uint32_t to static int Change 2. In the API set_first_connection_operating_channel Changed the wrong return value -EINVAL to return set_value Change 3. In the API set_second_connection_operating_channel Changed operating_channel == 0 to !operating_channel and return -EINVAL to return set_value Change 4. In the API hdd_update_tgt_cfg Removed the unused variable status = false Change 5. In API sme_set_ht2040_mode Changed the cb_mode condition from if(!session->cb_mode) to session->cb_mode==PHY_SINGLE_CHANNEL_CENTERED CRs-Fixed: 3891029 Change-Id: I697a915bf10ed2b331198a1621f75ffe7259628d
This commit is contained in:
parent
f064ac8d54
commit
642f82ef5e
@ -3508,7 +3508,7 @@ void hdd_get_roam_scan_ch_cb(hdd_handle_t hdd_handle,
|
||||
osif_request_put(request);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
static int
|
||||
hdd_get_roam_chan_from_fw(struct hdd_adapter *adapter, uint32_t *chan_list,
|
||||
uint8_t *num_channels)
|
||||
{
|
||||
@ -3578,7 +3578,7 @@ hdd_get_roam_scan_freq(struct hdd_adapter *adapter, mac_handle_t mac_handle,
|
||||
if (is_roam_ch_from_fw_supported(adapter->hdd_ctx)) {
|
||||
ret = hdd_get_roam_chan_from_fw(adapter, chan_list,
|
||||
num_channels);
|
||||
if (ret != QDF_STATUS_SUCCESS) {
|
||||
if (ret) {
|
||||
hdd_err("failed to get roam scan channel list from FW");
|
||||
return -EFAULT;
|
||||
}
|
||||
|
@ -3022,10 +3022,8 @@ int hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
|
||||
|
||||
status = ucfg_mlme_cfg_get_vht_tx_bfee_ant_supp(hdd_ctx->psoc,
|
||||
&value);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
status = false;
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
hdd_err("set tx_bfee_ant_supp failed");
|
||||
}
|
||||
|
||||
status = ucfg_mlme_set_restricted_80p80_bw_supp(hdd_ctx->psoc,
|
||||
cfg->restricted_80p80_bw_supp);
|
||||
@ -3036,10 +3034,8 @@ int hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
|
||||
!cfg->tx_bfee_8ss_enabled) {
|
||||
status = ucfg_mlme_cfg_set_vht_tx_bfee_ant_supp(hdd_ctx->psoc,
|
||||
MLME_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED_FW_DEF);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
status = false;
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
hdd_err("set tx_bfee_ant_supp failed");
|
||||
}
|
||||
}
|
||||
|
||||
hdd_update_tid_to_link_supported(hdd_ctx, &cfg->services);
|
||||
|
@ -1464,7 +1464,7 @@ static uint32_t set_first_connection_operating_channel(
|
||||
oper_chan_freq = hdd_get_operating_chan_freq(hdd_ctx, dev_mode);
|
||||
if (!oper_chan_freq) {
|
||||
hdd_err(" First adapter operating channel is invalid");
|
||||
return -EINVAL;
|
||||
return set_value;
|
||||
}
|
||||
operating_channel = wlan_reg_freq_to_chan(hdd_ctx->pdev,
|
||||
oper_chan_freq);
|
||||
@ -1504,9 +1504,9 @@ static uint32_t set_second_connection_operating_channel(
|
||||
policy_mgr_get_mcc_operating_channel(
|
||||
hdd_ctx->psoc, vdev_id));
|
||||
|
||||
if (operating_channel == 0) {
|
||||
if (!operating_channel) {
|
||||
hdd_err("Second adapter operating channel is invalid");
|
||||
return -EINVAL;
|
||||
return set_value;
|
||||
}
|
||||
|
||||
hdd_info("Second connection channel No.:%d and quota:%dms",
|
||||
|
@ -7710,17 +7710,17 @@ QDF_STATUS sme_set_ht2040_mode(mac_handle_t mac_handle, uint8_t sessionId,
|
||||
|
||||
switch (channel_type) {
|
||||
case eHT_CHAN_HT20:
|
||||
if (!session->cb_mode)
|
||||
if (session->cb_mode == PHY_SINGLE_CHANNEL_CENTERED)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
cb_mode = PHY_SINGLE_CHANNEL_CENTERED;
|
||||
break;
|
||||
case eHT_CHAN_HT40MINUS:
|
||||
if (session->cb_mode)
|
||||
if (session->cb_mode != PHY_SINGLE_CHANNEL_CENTERED)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
cb_mode = PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
|
||||
break;
|
||||
case eHT_CHAN_HT40PLUS:
|
||||
if (session->cb_mode)
|
||||
if (session->cb_mode != PHY_SINGLE_CHANNEL_CENTERED)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
cb_mode = PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user