summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Girigowda <sgirigow@codeaurora.org>2017-08-25 14:44:26 -0700
committerSrinivas Girigowda <sgirigow@codeaurora.org>2017-08-25 14:48:27 -0700
commit91cf6f5477bdeb504137a649b99f0cb40bd13c66 (patch)
tree8ee10e08d898478d0a4dfca9185a59cf31de3a48
parentb7050e89632e7af82bb3c6f10704226fa9c0f73e (diff)
qcacld-3.0: HDD: Fix checkpatch warnings
Fix checkpatch warnings. Change-Id: Ic329caab07db3a11db3474e7a85ad5957537e5be CRs-Fixed: 2099382
-rw-r--r--core/hdd/inc/wlan_hdd_lro.h2
-rw-r--r--core/hdd/inc/wlan_hdd_main.h3
-rw-r--r--core/hdd/src/wlan_hdd_assoc.c16
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c112
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.h7
-rw-r--r--core/hdd/src/wlan_hdd_conc_ut.c2
-rw-r--r--core/hdd/src/wlan_hdd_driver_ops.c3
-rw-r--r--core/hdd/src/wlan_hdd_ftm.c6
-rw-r--r--core/hdd/src/wlan_hdd_ipa.c17
-rw-r--r--core/hdd/src/wlan_hdd_lro.c4
-rw-r--r--core/hdd/src/wlan_hdd_main.c13
-rw-r--r--core/hdd/src/wlan_hdd_nan_datapath.c1
-rw-r--r--core/hdd/src/wlan_hdd_ocb.h7
-rw-r--r--core/hdd/src/wlan_hdd_packet_filter.c4
-rw-r--r--core/hdd/src/wlan_hdd_stats.c1
-rw-r--r--core/hdd/src/wlan_hdd_tdls.c38
-rw-r--r--core/hdd/src/wlan_hdd_wext.c6
-rw-r--r--core/hdd/src/wlan_hdd_wmm.c16
18 files changed, 113 insertions, 145 deletions
diff --git a/core/hdd/inc/wlan_hdd_lro.h b/core/hdd/inc/wlan_hdd_lro.h
index c6f2fd667b9f..17d18a08d170 100644
--- a/core/hdd/inc/wlan_hdd_lro.h
+++ b/core/hdd/inc/wlan_hdd_lro.h
@@ -163,7 +163,7 @@ struct hdd_lro_s {};
static inline int hdd_lro_enable(hdd_context_t *hdd_ctx,
hdd_adapter_t *adapter)
{
- return ENOSYS;
+ return -ENOSYS;
}
static inline QDF_STATUS hdd_lro_rx(hdd_adapter_t *adapter,
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index 1c979b39cc67..e28aceed91a6 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -2162,17 +2162,14 @@ void hdd_bus_bandwidth_destroy(hdd_context_t *hdd_ctx);
void hdd_bus_bw_compute_timer_start(hdd_context_t *hdd_ctx)
{
- return;
}
void hdd_bus_bw_compute_timer_try_start(hdd_context_t *hdd_ctx)
{
- return;
}
void hdd_bus_bw_compute_timer_stop(hdd_context_t *hdd_ctx)
{
- return;
}
void hdd_bus_bw_compute_timer_try_stop(hdd_context_t *hdd_ctx)
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index 3fa377dea1dd..672d52c59756 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -4057,13 +4057,13 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter,
hdd_debug("TDLS ExternalControl enabled but curr_peer is not forced, ignore SHOULD_DISCOVER");
status = QDF_STATUS_SUCCESS;
break;
- } else {
- hdd_debug("initiate TDLS setup on SHOULD_DISCOVER, fTDLSExternalControl: %d, curr_peer->isForcedPeer: %d, reason: %d",
- pHddCtx->config->
- fTDLSExternalControl,
- curr_peer->isForcedPeer,
- pRoamInfo->reasonCode);
}
+ hdd_debug("initiate TDLS setup on SHOULD_DISCOVER, fTDLSExternalControl: %d, curr_peer->isForcedPeer: %d, reason: %d",
+ pHddCtx->config->
+ fTDLSExternalControl,
+ curr_peer->isForcedPeer,
+ pRoamInfo->reasonCode);
+
pHddTdlsCtx->curr_candidate = curr_peer;
wlan_hdd_tdls_implicit_send_discovery_request(
pHddTdlsCtx);
@@ -5733,8 +5733,8 @@ static int __iw_set_essid(struct net_device *dev,
/*Try disconnecting if already in connected state*/
status = wlan_hdd_try_disconnect(pAdapter);
if (0 > status) {
- hdd_err("Failed to disconnect the existing connection");
- return -EALREADY;
+ hdd_err("Failed to disconnect the existing connection");
+ return -EALREADY;
}
/*
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index ee66c4a58cd7..817861bcfba6 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -649,12 +649,10 @@ static const struct wiphy_wowlan_support wowlan_support_cfg80211_init = {
static inline void hdd_add_channel_switch_support(uint32_t *flags)
{
*flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
- return;
}
#else
static inline void hdd_add_channel_switch_support(uint32_t *flags)
{
- return;
}
#endif
@@ -1292,6 +1290,7 @@ static void wlan_hdd_set_acs_ch_range(tsap_Config_t *sap_cfg,
bool ht_enabled, bool vht_enabled)
{
int i;
+
if (sap_cfg->acs_cfg.hw_mode == QCA_ACS_MODE_IEEE80211B) {
sap_cfg->acs_cfg.hw_mode = eCSR_DOT11_MODE_11b;
sap_cfg->acs_cfg.start_ch = CDS_CHANNEL_NUM(CHAN_ENUM_1);
@@ -1542,6 +1541,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
*/
if (tb[QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST]) {
char *tmp = nla_data(tb[QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST]);
+
sap_config->acs_cfg.ch_list_count = nla_len(
tb[QCA_WLAN_VENDOR_ATTR_ACS_CH_LIST]);
if (sap_config->acs_cfg.ch_list_count) {
@@ -1842,8 +1842,6 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
msecs_to_jiffies(500));
clear_bit(ACS_PENDING, &con_sap_adapter->event_flags);
}
-
- return;
}
static int
@@ -6175,10 +6173,9 @@ __wlan_hdd_cfg80211_offloaded_packets(struct wiphy *wiphy,
return wlan_hdd_add_tx_ptrn(adapter, hdd_ctx, tb);
else if (control == WLAN_STOP_OFFLOADED_PACKETS)
return wlan_hdd_del_tx_ptrn(adapter, hdd_ctx, tb);
- else {
- hdd_err("Invalid control: %d", control);
- return -EINVAL;
- }
+
+ hdd_err("Invalid control: %d", control);
+ return -EINVAL;
}
/*
@@ -6422,7 +6419,6 @@ void hdd_rssi_threshold_breached(void *hddctx,
fail:
kfree_skb(skb);
- return;
}
#define PWR_SAVE_FAIL_CMD_INDEX \
@@ -7787,8 +7783,6 @@ void hdd_get_bpf_offload_cb(void *hdd_context,
complete(&context->completion);
spin_unlock(&hdd_context_lock);
-
- return;
}
/**
@@ -8214,9 +8208,8 @@ static int wlan_hdd_validate_and_get_pre_cac_ch(hdd_context_t *hdd_ctx,
!CDS_IS_DFS_CH(channel)) {
hdd_err("Invalid channel for pre cac:%d", channel);
return -EINVAL;
- } else {
- *pre_cac_chan = channel;
}
+ *pre_cac_chan = channel;
}
hdd_debug("selected pre cac channel:%d", *pre_cac_chan);
return 0;
@@ -8614,13 +8607,10 @@ static enum sta_roam_policy_dfs_mode wlan_hdd_get_sta_roam_dfs_mode(
switch (mode) {
case DFS_MODE_ENABLE:
return CSR_STA_ROAM_POLICY_DFS_ENABLED;
- break;
case DFS_MODE_DISABLE:
return CSR_STA_ROAM_POLICY_DFS_DISABLED;
- break;
case DFS_MODE_DEPRIORITIZE:
return CSR_STA_ROAM_POLICY_DFS_DEPRIORITIZE;
- break;
default:
hdd_err("STA Roam policy dfs mode is NONE");
return CSR_STA_ROAM_POLICY_NONE;
@@ -8641,6 +8631,7 @@ uint8_t hdd_get_sap_operating_band(hdd_context_t *hdd_ctx)
hdd_adapter_t *adapter;
uint8_t operating_channel = 0;
uint8_t sap_operating_band = 0;
+
status = hdd_get_front_adapter(hdd_ctx, &adapter_node);
while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) {
adapter = adapter_node->pAdapter;
@@ -10032,8 +10023,6 @@ void wlan_hdd_cfg80211_chainrssi_callback(void *ctx, void *pmsg)
complete(&context->response_event);
spin_unlock(&hdd_context_lock);
-
- return;
}
/**
@@ -10774,6 +10763,7 @@ static int __wlan_hdd_cfg80211_fetch_bss_transition_status(struct wiphy *wiphy,
struct net_device *dev = wdev->netdev;
hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
hdd_station_ctx_t *hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
+
const struct nla_policy
btm_params_policy[QCA_WLAN_VENDOR_ATTR_MAX + 1] = {
[QCA_WLAN_VENDOR_ATTR_BTM_MBO_TRANSITION_REASON] = {
@@ -11932,14 +11922,13 @@ int wlan_hdd_cfg80211_init(struct device *dev,
wlan_hdd_band_5_ghz.ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_20;
}
- if (!pCfg->ShortGI40MhzEnable) {
- wlan_hdd_band_5_ghz.ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
- }
+ if (!pCfg->ShortGI40MhzEnable)
+ wlan_hdd_band_5_ghz.ht_cap.cap &=
+ ~IEEE80211_HT_CAP_SGI_40;
- if (!pCfg->nChannelBondingMode5GHz) {
+ if (!pCfg->nChannelBondingMode5GHz)
wlan_hdd_band_5_ghz.ht_cap.cap &=
~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
- }
/*
* In case of static linked driver at the time of driver unload,
@@ -12028,9 +12017,8 @@ int wlan_hdd_cfg80211_init(struct device *dev,
ARRAY_SIZE(wlan_hdd_cfg80211_vendor_events);
}
- if (pCfg->enableDFSMasterCap) {
+ if (pCfg->enableDFSMasterCap)
wiphy->flags |= WIPHY_FLAG_DFS_OFFLOAD;
- }
wiphy->max_ap_assoc_sta = pCfg->maxNumberOfPeers;
@@ -12412,11 +12400,11 @@ void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t *pAdapter, uint8_t key_index,
setKey.encType = eCSR_ENCRYPT_TYPE_WPI; /* SET WAPI Encryption */
setKey.keyDirection = eSIR_TX_RX; /* Key Directionn both TX and RX */
setKey.paeRole = 0; /* the PAE role */
- if (!mac_addr || is_broadcast_ether_addr(mac_addr)) {
+ if (!mac_addr || is_broadcast_ether_addr(mac_addr))
qdf_set_macaddr_broadcast(&setKey.peerMac);
- } else {
+ else
qdf_mem_copy(setKey.peerMac.bytes, mac_addr, QDF_MAC_ADDR_SIZE);
- }
+
setKey.keyLength = key_Len;
pKeyPtr = setKey.Key;
memcpy(pKeyPtr, key, key_Len);
@@ -12451,9 +12439,8 @@ uint8_t *wlan_hdd_cfg80211_get_ie_ptr(const uint8_t *ies_ptr, int length,
eid, elem_len, left);
return NULL;
}
- if (elem_id == eid) {
+ if (elem_id == eid)
return ptr;
- }
left -= elem_len;
ptr += (elem_len + 2);
@@ -12521,9 +12508,8 @@ QDF_STATUS wlan_hdd_validate_operation_channel(hdd_adapter_t *pAdapter,
return QDF_STATUS_E_FAILURE;
}
for (indx = 0; indx < num_ch; indx++) {
- if (channel == valid_ch[indx]) {
+ if (channel == valid_ch[indx])
break;
- }
}
if (indx >= num_ch) {
@@ -12544,6 +12530,7 @@ static void wlan_hdd_set_dhcp_server_offload(hdd_adapter_t *pHostapdAdapter)
uint8_t srv_ip[IPADDR_NUM_ENTRIES];
uint8_t num;
uint32_t temp;
+
pDhcpSrvInfo = qdf_mem_malloc(sizeof(*pDhcpSrvInfo));
if (NULL == pDhcpSrvInfo) {
hdd_err("could not allocate tDhcpSrvOffloadInfo!");
@@ -12578,7 +12565,6 @@ static void wlan_hdd_set_dhcp_server_offload(hdd_adapter_t *pHostapdAdapter)
hdd_debug("enable DHCP Server offload successfully!");
end:
qdf_mem_free(pDhcpSrvInfo);
- return;
}
#endif /* DHCP_SERVER_OFFLOAD */
@@ -12631,9 +12617,8 @@ static int __wlan_hdd_cfg80211_change_bss(struct wiphy *wiphy,
pAdapter->sessionCtx.
ap.
apDisableIntraBssFwd);
- if (!QDF_IS_STATUS_SUCCESS(qdf_ret_status)) {
+ if (!QDF_IS_STATUS_SUCCESS(qdf_ret_status))
ret = -EINVAL;
- }
}
EXIT();
@@ -12719,6 +12704,7 @@ static int wlan_hdd_cfg80211_change_bss(struct wiphy *wiphy,
void *wlan_hdd_change_country_code_cb(void *pAdapter)
{
hdd_adapter_t *call_back_pAdapter = pAdapter;
+
complete(&call_back_pAdapter->change_country_code);
return NULL;
}
@@ -12960,6 +12946,7 @@ static bool wlan_hdd_is_duplicate_channel(uint8_t *arr,
int index, uint8_t match)
{
int i;
+
for (i = 0; i < index; i++) {
if (arr[i] == match)
return true;
@@ -13065,10 +13052,12 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
int i = 0, j = 0, k = 0, no_of_channels = 0;
int num_unique_channels;
int next;
+
for (i = 0;
i < params->supported_channels_len
&& j < SIR_MAC_MAX_SUPP_CHANNELS; i += 2) {
int wifi_chan_index;
+
if (!wlan_hdd_is_duplicate_channel
(StaParams.supported_channels, j,
params->supported_channels[i])) {
@@ -13178,6 +13167,7 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
if (0 != StaParams.supported_rates_len) {
int i = 0;
+
qdf_mem_copy(StaParams.supported_rates,
params->supported_rates,
StaParams.supported_rates_len);
@@ -13198,13 +13188,12 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
if (0 != params->ext_capab_len) {
/*Define A Macro : TODO Sunil */
- if ((1 << 4) & StaParams.extn_capability[3]) {
+ if ((1 << 4) & StaParams.extn_capability[3])
isBufSta = 1;
- }
+
/* TDLS Channel Switching Support */
- if ((1 << 6) & StaParams.extn_capability[3]) {
+ if ((1 << 6) & StaParams.extn_capability[3])
isOffChannelSupported = 1;
- }
}
if (pHddCtx->config->fEnableTDLSWmmMode &&
@@ -13351,8 +13340,8 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
case WLAN_CIPHER_SUITE_TKIP:
{
u8 *pKey = &setKey.Key[0];
- setKey.encType = eCSR_ENCRYPT_TYPE_TKIP;
+ setKey.encType = eCSR_ENCRYPT_TYPE_TKIP;
qdf_mem_zero(pKey, CSR_MAX_KEY_LEN);
/*Supplicant sends the 32bytes key in this order
@@ -13584,6 +13573,7 @@ static int wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
struct key_params *params)
{
int ret;
+
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_add_key(wiphy, ndev, key_index, pairwise,
mac_addr, params);
@@ -13930,8 +13920,8 @@ struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_list(
return bss;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4 , 3, 0)) || \
- defined (CFG80211_INFORM_BSS_FRAME_DATA)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)) || \
+ defined(CFG80211_INFORM_BSS_FRAME_DATA)
static struct cfg80211_bss *
wlan_hdd_cfg80211_inform_bss_frame_data(struct wiphy *wiphy,
struct ieee80211_channel *chan,
@@ -14737,6 +14727,7 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
if (pRoamProfile) {
hdd_station_ctx_t *pHddStaCtx;
+
pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
/* Restart the opportunistic timer
@@ -15424,6 +15415,7 @@ static int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
while (remLen >= 2) {
uint16_t eLen = 0;
uint8_t elementId;
+
elementId = *genie++;
eLen = *genie++;
remLen -= 2;
@@ -15885,17 +15877,17 @@ static int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter,
{
int status = 0;
hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
+
ENTER();
/*set wpa version */
pWextState->wpaVersion = IW_AUTH_WPA_VERSION_DISABLED;
if (req->crypto.wpa_versions) {
- if (NL80211_WPA_VERSION_1 == req->crypto.wpa_versions) {
+ if (NL80211_WPA_VERSION_1 == req->crypto.wpa_versions)
pWextState->wpaVersion = IW_AUTH_WPA_VERSION_WPA;
- } else if (NL80211_WPA_VERSION_2 == req->crypto.wpa_versions) {
+ else if (NL80211_WPA_VERSION_2 == req->crypto.wpa_versions)
pWextState->wpaVersion = IW_AUTH_WPA_VERSION_WPA2;
- }
}
hdd_debug("set wpa version to %d", pWextState->wpaVersion);
@@ -16347,6 +16339,7 @@ static int wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
struct cfg80211_connect_params *req)
{
int ret;
+
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_connect(wiphy, ndev, req);
cds_ssr_unprotect(__func__);
@@ -16652,6 +16645,7 @@ static int wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
struct net_device *dev, u16 reason)
{
int ret;
+
cds_ssr_protect(__func__);
ret = __wlan_hdd_cfg80211_disconnect(wiphy, dev, reason);
cds_ssr_unprotect(__func__);
@@ -16813,9 +16807,8 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
}
for (indx = 0; indx < numChans; indx++) {
- if (channelNum == validChan[indx]) {
+ if (channelNum == validChan[indx])
break;
- }
}
if (indx >= numChans) {
hdd_err("Not valid Channel: %d", channelNum);
@@ -17333,6 +17326,7 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
if (qdf_is_macaddr_broadcast((struct qdf_mac_addr *) mac)) {
uint16_t i;
+
for (i = 0; i < WLAN_MAX_STA_COUNT; i++) {
if ((pAdapter->aStaInfo[i].isUsed) &&
(!pAdapter->aStaInfo[i].
@@ -17419,14 +17413,13 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
MAC_ADDRESS_STR,
MAC_ADDR_ARRAY(mac));
return -ENOENT;
- } else {
- qdf_status = qdf_wait_single_event(
- &hapd_state->
- qdf_sta_disassoc_event,
- SME_CMD_TIMEOUT_VALUE);
- if (!QDF_IS_STATUS_SUCCESS(qdf_status))
- hdd_warn("Deauth wait time expired");
}
+ qdf_status = qdf_wait_single_event(
+ &hapd_state->
+ qdf_sta_disassoc_event,
+ SME_CMD_TIMEOUT_VALUE);
+ if (!QDF_IS_STATUS_SUCCESS(qdf_status))
+ hdd_warn("Deauth wait time expired");
}
}
@@ -17445,6 +17438,7 @@ fn_end:
void wlan_hdd_del_station(hdd_adapter_t *adapter)
{
struct station_del_parameters del_sta;
+
del_sta.mac = NULL;
del_sta.subtype = SIR_MAC_MGMT_DEAUTH >> 4;
del_sta.reason_code = eCsrForcedDeauthSta;
@@ -18077,9 +18071,8 @@ void wlan_hdd_cfg80211_update_replay_counter_cb(void *callbackContext,
uint8_t *p =
(uint8_t *) &pGtkOffloadGetInfoRsp->ullKeyReplayCounter;
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < 8; i++)
tempReplayCounter[7 - i] = (uint8_t) p[i];
- }
}
hdd_debug("GtkOffloadGetInfoRsp replay counter 0x%llx, value reported to supplicant 0x%llx",
@@ -18426,8 +18419,6 @@ static void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx,
nla_put_failure:
hdd_err("NLA Put fail");
kfree_skb(skb);
-
- return;
}
#endif /* FEATURE_WLAN_LPHB */
@@ -18838,6 +18829,7 @@ enum cds_con_mode wlan_hdd_convert_nl_iftype_to_hdd_type(
enum nl80211_iftype type)
{
enum cds_con_mode mode = CDS_MAX_NUM_OF_MODE;
+
switch (type) {
case NL80211_IFTYPE_STATION:
mode = CDS_STA_MODE;
@@ -18976,8 +18968,6 @@ void wlan_hdd_clear_link_layer_stats(hdd_adapter_t *adapter)
link_layer_stats_clear_req.reqId = 1;
link_layer_stats_clear_req.staId = adapter->sessionId;
sme_ll_stats_clear_req(hal, &link_layer_stats_clear_req);
-
- return;
}
#if defined(WLAN_FEATURE_FILS_SK) &&\
@@ -19397,7 +19387,7 @@ static struct cfg80211_ops wlan_hdd_cfg80211_ops = {
#endif
.set_monitor_channel = wlan_hdd_cfg80211_set_mon_ch,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) || \
- defined(CFG80211_ABORT_SCAN)
+ defined(CFG80211_ABORT_SCAN)
.abort_scan = wlan_hdd_cfg80211_abort_scan,
#endif
#if defined(WLAN_FEATURE_FILS_SK) &&\
diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h
index 4b6849174153..c4342e2330a8 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.h
+++ b/core/hdd/src/wlan_hdd_cfg80211.h
@@ -149,7 +149,7 @@ typedef struct {
#define WLAN_IS_TDLS_SETUP_ACTION(action) \
((SIR_MAC_TDLS_SETUP_REQ <= action) && \
(SIR_MAC_TDLS_SETUP_CNF >= action))
-#if !defined (TDLS_MGMT_VERSION2)
+#if !defined(TDLS_MGMT_VERSION2)
#define TDLS_MGMT_VERSION2 0
#endif
@@ -453,7 +453,7 @@ static inline int wlan_hdd_send_roam_auth_event(hdd_adapter_t *adapter,
int wlan_hdd_cfg80211_update_apies(hdd_adapter_t *adapter);
-#if !(defined (SUPPORT_WDEV_CFG80211_VENDOR_EVENT_ALLOC)) && \
+#if !(defined(SUPPORT_WDEV_CFG80211_VENDOR_EVENT_ALLOC)) && \
(LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) && \
!(defined(WITH_BACKPORTS))
@@ -500,7 +500,8 @@ int wlan_hdd_disable_dfs_chan_scan(hdd_context_t *hdd_ctx,
int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy,
eCsrBand eBand);
-void hdd_get_bpf_offload_cb(void *hdd_context, struct sir_bpf_get_offload *);
+void hdd_get_bpf_offload_cb(void *hdd_context,
+ struct sir_bpf_get_offload *data);
void hdd_init_bpf_completion(void);
#if defined(CFG80211_DISCONNECTED_V2) || \
diff --git a/core/hdd/src/wlan_hdd_conc_ut.c b/core/hdd/src/wlan_hdd_conc_ut.c
index 121c86031c61..b9dfaa7a2437 100644
--- a/core/hdd/src/wlan_hdd_conc_ut.c
+++ b/core/hdd/src/wlan_hdd_conc_ut.c
@@ -150,6 +150,7 @@ static const char *pcl_type_to_string(uint8_t idx)
void clean_report(hdd_context_t *hdd_ctx)
{
uint32_t idx = 0;
+
while (idx < NUMBER_OF_SCENARIO) {
qdf_mem_zero(&report[idx], sizeof(struct report_t));
idx++;
@@ -160,6 +161,7 @@ void clean_report(hdd_context_t *hdd_ctx)
void print_report(hdd_context_t *hdd_ctx)
{
uint32_t idx = 0;
+
pr_info("+----------Report start -----------+\n");
while (idx < report_idx) {
pr_info("Idx:[%d]\nTitle:%s\nResult:[%s]\n\t1st_person[%s]\n\t2nd_persona[%s]\n\t3rd_persona[%s]\n\tDBS[%s]\n\tsystem_config[%s]\n\treason[%s]\n\tpcl[%s]\n",
diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c
index a298195c297f..9f46387c4596 100644
--- a/core/hdd/src/wlan_hdd_driver_ops.c
+++ b/core/hdd/src/wlan_hdd_driver_ops.c
@@ -401,8 +401,7 @@ err_hdd_deinit:
if (reinit) {
cds_set_driver_in_bad_state(true);
cds_set_recovery_in_progress(false);
- }
- else
+ } else
cds_set_load_in_progress(false);
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_INIT);
diff --git a/core/hdd/src/wlan_hdd_ftm.c b/core/hdd/src/wlan_hdd_ftm.c
index 993eef966dc0..62f6ebf730d2 100644
--- a/core/hdd/src/wlan_hdd_ftm.c
+++ b/core/hdd/src/wlan_hdd_ftm.c
@@ -166,7 +166,6 @@ void hdd_ftm_mc_process_msg(void *message)
wlan_hdd_testmode_rx_event(data, (size_t) data_len);
#endif
#endif
- return;
}
#if defined(QCA_WIFI_FTM)
@@ -314,11 +313,10 @@ int wlan_hdd_qcmbr_unified_ioctl(hdd_adapter_t *adapter, struct ifreq *ifr)
{
int ret = 0;
- if (is_compat_task()) {
+ if (is_compat_task())
ret = wlan_hdd_qcmbr_compat_ioctl(adapter, ifr);
- } else {
+ else
ret = wlan_hdd_qcmbr_ioctl(adapter, ifr);
- }
return ret;
}
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c
index ac382d7714dc..7c61cfc56fe4 100644
--- a/core/hdd/src/wlan_hdd_ipa.c
+++ b/core/hdd/src/wlan_hdd_ipa.c
@@ -550,13 +550,9 @@ struct hdd_ipa_priv {
(((_hdd_ctx)->config->IpaConfig & (_mask)) == (_mask))
#define HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa) \
- do { \
- hdd_ipa->ipa_rx_internel_drop_count++; \
- } while (0)
+ hdd_ipa->ipa_rx_internel_drop_count++;
#define HDD_IPA_INCREASE_NET_SEND_COUNT(hdd_ipa) \
- do { \
- hdd_ipa->ipa_rx_net_send_count++; \
- } while (0)
+ hdd_ipa->ipa_rx_net_send_count++;
#define HDD_BW_GET_DIFF(_x, _y) (unsigned long)((ULONG_MAX - (_y)) + (_x) + 1)
#if defined(QCA_WIFI_3_0) && defined(CONFIG_IPA3)
@@ -5795,12 +5791,11 @@ static int __hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
qdf_mutex_release(&hdd_ipa->ipa_lock);
}
return 0;
- } else {
- HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
- "IPA resource %s completed",
- hdd_ipa->resource_loading ?
- "load" : "unload");
}
+ HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
+ "IPA resource %s completed",
+ hdd_ipa->resource_loading ?
+ "load" : "unload");
}
hdd_ipa->stats.event[type]++;
diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c
index a610aea51f40..a9972b59a2d1 100644
--- a/core/hdd/src/wlan_hdd_lro.c
+++ b/core/hdd/src/wlan_hdd_lro.c
@@ -485,7 +485,7 @@ int hdd_lro_enable(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
if ((hdd_ctx->ol_enable != CFG_LRO_ENABLED) ||
QDF_STA_MODE != adapter->device_mode) {
- return EOPNOTSUPP;
+ return -EOPNOTSUPP;
}
/*
@@ -494,7 +494,7 @@ int hdd_lro_enable(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter)
* the LRO again. Keep the LRO state same as before SSR.
*/
if (qdf_atomic_read(&hdd_ctx->vendor_disable_lro_flag))
- return EPERM;
+ return -EPERM;
adapter->dev->features |= NETIF_F_LRO;
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 4da2afbf6a92..8227872e5d80 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -649,9 +649,8 @@ int wlan_hdd_validate_context(hdd_context_t *hdd_ctx)
return -EAGAIN;
}
- if (cds_is_load_or_unload_in_progress()) {
+ if (cds_is_load_or_unload_in_progress())
return -EAGAIN;
- }
if (hdd_ctx->start_modules_in_progress ||
hdd_ctx->stop_modules_in_progress) {
@@ -1964,8 +1963,6 @@ static void hdd_update_hw_sw_info(hdd_context_t *hdd_ctx)
/* Get the wlan hw/fw version */
hdd_wlan_get_version(hdd_ctx, NULL, NULL);
-
- return;
}
/**
@@ -4665,8 +4662,8 @@ static void hdd_connect_done(struct net_device *dev, const u8 *bssid,
struct cfg80211_bss *bss, tCsrRoamInfo *roam_info,
const u8 *req_ie, size_t req_ie_len,
const u8 *resp_ie, size_t resp_ie_len, u16 status,
- gfp_t gfp, bool connect_timeout, tSirResultCodes
- timeout_reason)
+ gfp_t gfp, bool connect_timeout,
+ tSirResultCodes timeout_reason)
{
struct cfg80211_connect_resp_params fils_params;
hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
@@ -4718,8 +4715,8 @@ static inline void hdd_connect_done(struct net_device *dev, const u8 *bssid,
*roam_info, const u8 *req_ie,
size_t req_ie_len, const u8 *resp_ie,
size_t resp_ie_len, u16 status, gfp_t gfp,
- bool connect_timeout, tSirResultCodes
- timeout_reason)
+ bool connect_timeout,
+ tSirResultCodes timeout_reason)
{ }
#endif
#endif
diff --git a/core/hdd/src/wlan_hdd_nan_datapath.c b/core/hdd/src/wlan_hdd_nan_datapath.c
index 098966c81843..75a53ddd72cb 100644
--- a/core/hdd/src/wlan_hdd_nan_datapath.c
+++ b/core/hdd/src/wlan_hdd_nan_datapath.c
@@ -1053,7 +1053,6 @@ nla_put_failure:
close_ndi:
hdd_close_ndi(adapter);
qdf_mem_free(roam_info);
- return;
}
/**
diff --git a/core/hdd/src/wlan_hdd_ocb.h b/core/hdd/src/wlan_hdd_ocb.h
index b76c7fd0c495..784017a4f61c 100644
--- a/core/hdd/src/wlan_hdd_ocb.h
+++ b/core/hdd/src/wlan_hdd_ocb.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -298,12 +298,10 @@ void wlan_hdd_dcc_stats_event(void *context_ptr, void *response_ptr);
#else
static inline void hdd_set_dot11p_config(hdd_context_t *hdd_ctx)
{
- return;
}
static inline void hdd_remove_ocb_tx_header(struct sk_buff *skb)
{
- return;
}
static inline int iw_set_dot11p_channel_sched(struct net_device *dev,
struct iw_request_info *info,
@@ -379,12 +377,11 @@ static inline int wlan_hdd_cfg80211_dcc_update_ndl(struct wiphy *wiphy,
static inline void wlan_hdd_dcc_register_for_dcc_stats_event(
hdd_context_t *hdd_ctx)
{
- return;
}
+
static inline void wlan_hdd_dcc_stats_event(void *context_ptr,
void *response_ptr)
{
- return;
}
#endif
diff --git a/core/hdd/src/wlan_hdd_packet_filter.c b/core/hdd/src/wlan_hdd_packet_filter.c
index 1b0c3cfa3a86..9f3572afd0e6 100644
--- a/core/hdd/src/wlan_hdd_packet_filter.c
+++ b/core/hdd/src/wlan_hdd_packet_filter.c
@@ -46,7 +46,7 @@ int hdd_enable_default_pkt_filters(hdd_adapter_t *pAdapter)
while (filters != 0) {
if (filters & 0x1) {
- hdd_err("setting filter[%d], of id = %d \n",
+ hdd_err("setting filter[%d], of id = %d\n",
i+1, filter_id);
packet_filter_default_rules[i].filter_id = filter_id;
wlan_hdd_set_filter(pHddCtx,
@@ -83,7 +83,7 @@ int hdd_disable_default_pkt_filters(hdd_adapter_t *pAdapter)
while (filters != 0) {
if (filters & 0x1) {
- hdd_err("Clearing filter[%d], of id = %d \n",
+ hdd_err("Clearing filter[%d], of id = %d\n",
i+1, filter_id);
packet_filter_default_rules.filter_action =
HDD_RCV_FILTER_CLEAR;
diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c
index 8ba4be3b371b..2a44bd103080 100644
--- a/core/hdd/src/wlan_hdd_stats.c
+++ b/core/hdd/src/wlan_hdd_stats.c
@@ -4739,6 +4739,7 @@ static int __wlan_hdd_cfg80211_dump_survey(struct wiphy *wiphy,
for (i = 0; i < NUM_NL80211_BANDS && !filled; i++) {
struct ieee80211_supported_band *band = wiphy->bands[i];
+
if (NULL == wiphy->bands[i])
continue;
for (j = 0; j < wiphy->bands[i]->n_channels && !filled; j++) {
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c
index 4cb00a176572..1108e989539c 100644
--- a/core/hdd/src/wlan_hdd_tdls.c
+++ b/core/hdd/src/wlan_hdd_tdls.c
@@ -1708,8 +1708,7 @@ static void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx,
*/
if (pHddCtx->tdls_source_bitmap) {
mutex_unlock(&pHddCtx->tdls_lock);
- hdd_debug("Don't enable TDLS, source"
- "bitmap: %lu",
+ hdd_debug("Don't enable TDLS, source bitmap: %lu",
pHddCtx->tdls_source_bitmap);
return;
}
@@ -2079,6 +2078,7 @@ void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter,
tCsrRoamInfo *csr_roam_info)
{
hdd_context_t *hdd_ctx;
+
hdd_info("Check and update TDLS state");
if (cds_mode_specific_connection_count(CDS_SAP_MODE, NULL) >= 1) {
@@ -4186,23 +4186,22 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
action_code, numCurrTdlsPeers,
pHddCtx->max_num_tdls_sta);
return -EINVAL;
- } else {
- /* maximum reached. tweak to send error code to
- * peer and return error code to supplicant
- */
- status_code = eSIR_MAC_UNSPEC_FAILURE_STATUS;
- QDF_TRACE(QDF_MODULE_ID_HDD,
- QDF_TRACE_LEVEL_ERROR,
- "%s: " MAC_ADDRESS_STR
- " TDLS Max peer already connected, send response status (%d). Num of peers (%d), Max allowed (%d).",
- __func__, MAC_ADDR_ARRAY(peer),
- status_code, numCurrTdlsPeers,
- pHddCtx->max_num_tdls_sta);
- max_sta_failed = -EPERM;
- /* fall through to send setup resp with failure
- * status code
- */
}
+ /* maximum reached. tweak to send error code to
+ * peer and return error code to supplicant
+ */
+ status_code = eSIR_MAC_UNSPEC_FAILURE_STATUS;
+ QDF_TRACE(QDF_MODULE_ID_HDD,
+ QDF_TRACE_LEVEL_ERROR,
+ "%s: " MAC_ADDRESS_STR
+ " TDLS Max peer already connected, send response status (%d). Num of peers (%d), Max allowed (%d).",
+ __func__, MAC_ADDR_ARRAY(peer),
+ status_code, numCurrTdlsPeers,
+ pHddCtx->max_num_tdls_sta);
+ max_sta_failed = -EPERM;
+ /* fall through to send setup resp with failure
+ * status code
+ */
} else {
hddTdlsPeer_t *pTdlsPeer;
@@ -6255,9 +6254,8 @@ int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx,
if (hdd_ctx->tdls_nss_teardown_complete == false) {
hdd_err("TDLS antenna switch is in progress");
return -EAGAIN;
- } else {
- goto tdls_ant_sw_done;
}
+ goto tdls_ant_sw_done;
}
/* Check whether TDLS is connected or not */
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index 96f8a4f2b904..40f1789d9075 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -4161,7 +4161,7 @@ uint8_t *wlan_hdd_get_vendor_oui_ie_ptr(uint8_t *oui, uint8_t oui_size,
eid, elem_len, left);
return NULL;
}
- if ((elem_id == eid) && (elem_len >= oui_size)){
+ if ((elem_id == eid) && (elem_len >= oui_size)) {
if (memcmp(&ptr[2], oui, oui_size) == 0)
return ptr;
}
@@ -9158,8 +9158,8 @@ static int __iw_setnone_getint(struct net_device *dev,
{
sme_get_config_param(hHal, sme_config);
*value = (sme_config->csrConfig.enable2x2 == 0) ? 1 : 2;
- if (wma_is_current_hwmode_dbs())
- *value = *value-1;
+ if (wma_is_current_hwmode_dbs())
+ *value = *value - 1;
hdd_debug("GET_NSS: Current NSS:%d", *value);
break;
}
diff --git a/core/hdd/src/wlan_hdd_wmm.c b/core/hdd/src/wlan_hdd_wmm.c
index 36b58dcf655e..461875cb4af2 100644
--- a/core/hdd/src/wlan_hdd_wmm.c
+++ b/core/hdd/src/wlan_hdd_wmm.c
@@ -96,7 +96,6 @@ void wlan_hdd_process_peer_unauthorised_pause(hdd_adapter_t *adapter)
#else
void wlan_hdd_process_peer_unauthorised_pause(hdd_adapter_t *adapter)
{
- return;
}
#endif
@@ -371,8 +370,6 @@ static void hdd_wmm_inactivity_timer_cb(void *user_data)
QDF_TIMER_STATE_STOPPED);
}
}
-
- return;
}
/**
@@ -416,9 +413,9 @@ hdd_wmm_enable_inactivity_timer(struct hdd_wmm_qos_context *pQosContext,
hdd_err("Starting inactivity timer failed on AC %d",
acType);
qdf_status = qdf_mc_timer_destroy(&pAc->wmmInactivityTimer);
- if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
+ if (!QDF_IS_STATUS_SUCCESS(qdf_status))
hdd_err("Failed to destroy inactivity timer");
- }
+
return qdf_status;
}
pAc->wmmInactivityTime = inactivityTime;
@@ -1268,9 +1265,8 @@ QDF_STATUS hdd_wmm_init(hdd_adapter_t *pAdapter)
/* DSCP to User Priority Lookup Table
* By default use the 3 Precedence bits of DSCP as the User Priority
*/
- for (dscp = 0; dscp <= WLAN_HDD_MAX_DSCP; dscp++) {
+ for (dscp = 0; dscp <= WLAN_HDD_MAX_DSCP; dscp++)
hddWmmDscpToUpMap[dscp] = dscp >> 3;
- }
/* Special case for Expedited Forwarding (DSCP 46) */
hddWmmDscpToUpMap[46] = SME_QOS_WMM_UP_VO;
@@ -1503,8 +1499,6 @@ void hdd_wmm_classify_pkt(hdd_adapter_t *adapter,
#ifdef HDD_WMM_DEBUG
hdd_debug("tos is %d, dscp is %d, up is %d", tos, dscp, *user_pri);
#endif /* HDD_WMM_DEBUG */
-
- return;
}
/**
@@ -1569,6 +1563,7 @@ uint16_t hdd_hostapd_select_queue(struct net_device *dev, struct sk_buff *skb
hdd_context_t *hddctx = WLAN_HDD_GET_CTX(adapter);
bool is_eapol = false;
int status = 0;
+
status = wlan_hdd_validate_context(hddctx);
if (status != 0) {
@@ -1888,9 +1883,8 @@ QDF_STATUS hdd_wmm_assoc(hdd_adapter_t *pAdapter,
pAdapter->hddWmmDscpToUpMap,
pAdapter->sessionId);
- if (!QDF_IS_STATUS_SUCCESS(status)) {
+ if (!QDF_IS_STATUS_SUCCESS(status))
hdd_wmm_init(pAdapter);
- }
EXIT();