[PATCH v2 6/6] staging: rtl8723bs: core: Move logical operator to previous line.
Move logical operator to previous line to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 0b5bd047a552..b5e355de1199 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -5656,9 +5656,9 @@ static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta) ); #endif - if ((sta_rx_data_pkts(psta) == sta_last_rx_data_pkts(psta)) - && sta_rx_beacon_pkts(psta) == sta_last_rx_beacon_pkts(psta) - && sta_rx_probersp_pkts(psta) == sta_last_rx_probersp_pkts(psta) + if ((sta_rx_data_pkts(psta) == sta_last_rx_data_pkts(psta)) && + sta_rx_beacon_pkts(psta) == sta_last_rx_beacon_pkts(psta) && +sta_rx_probersp_pkts(psta) == sta_last_rx_probersp_pkts(psta) ) { ret = false; } else { -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 5/6] staging: rtl8723bs: core: Fix variable constant comparisons.
Swap the terms of comparisons whenever the constant comes first to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index a8ceaa9f8718..0b5bd047a552 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -1276,7 +1276,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) status = _STATS_FAILURE_; } - if (_STATS_SUCCESSFUL_ != status) + if (status != _STATS_SUCCESSFUL_) goto OnAssocReqFail; /* check if the supported rate is ok */ @@ -1372,7 +1372,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) wpa_ie_len = 0; } - if (_STATS_SUCCESSFUL_ != status) + if (status != _STATS_SUCCESSFUL_) goto OnAssocReqFail; pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/6] staging: rtl8723bs: core: Remove unnecessary parentheses.
Remove unnecessary parentheses after 'address-of' operator to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index ac70bbaae722..1cf6229a538b 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -277,7 +277,7 @@ void init_mlme_default_rate_set(struct adapter *padapter) static void init_mlme_ext_priv_value(struct adapter *padapter) { struct mlme_ext_priv *pmlmeext = >mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct mlme_ext_info *pmlmeinfo = >mlmext_info; atomic_set(>event_seq, 0); pmlmeext->mgnt_seq = 0;/* reset to zero when disconnect at client mode */ @@ -464,8 +464,8 @@ int init_mlme_ext_priv(struct adapter *padapter) int res = _SUCCESS; struct registry_priv *pregistrypriv = >registrypriv; struct mlme_ext_priv *pmlmeext = >mlmeextpriv; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct mlme_priv *pmlmepriv = >mlmepriv; + struct mlme_ext_info *pmlmeinfo = >mlmext_info; pmlmeext->padapter = padapter; @@ -609,8 +609,8 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) unsigned char *p; struct mlme_priv *pmlmepriv = >mlmepriv; struct mlme_ext_priv *pmlmeext = >mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - struct wlan_bssid_ex*cur = &(pmlmeinfo->network); + struct mlme_ext_info *pmlmeinfo = >mlmext_info; + struct wlan_bssid_ex*cur = >network; u8 *pframe = precv_frame->u.hdr.rx_data; uint len = precv_frame->u.hdr.len; u8 is_valid_p2p_probereq = false; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 4/6] staging: rtl8723bs: core: Remove braces from single if statement.
Remove braces from single if statement to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 1cf6229a538b..a8ceaa9f8718 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -370,9 +370,8 @@ static void init_channel_list(struct adapter *padapter, RT_CHANNEL_INFO *channel struct p2p_reg_class *reg = NULL; for (ch = o->min_chan; ch <= o->max_chan; ch += o->inc) { - if (!has_channel(channel_set, chanset_size, ch)) { + if (!has_channel(channel_set, chanset_size, ch)) continue; - } if ((0 == padapter->registrypriv.ht_enable) && (8 == o->inc)) continue; @@ -1950,9 +1949,8 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra category = frame_body[0]; if (category == RTW_WLAN_CATEGORY_BACK) {/* representing Block Ack */ - if (!pmlmeinfo->HT_enable) { + if (!pmlmeinfo->HT_enable) return _SUCCESS; - } action = frame_body[1]; DBG_871X("%s, action =%d\n", __func__, action); @@ -2397,9 +2395,8 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg pxmitpriv->ack_tx = true; pxmitpriv->seq_no = seq_no++; pmgntframe->ack_report = 1; - if (rtw_hal_mgnt_xmit(padapter, pmgntframe) == _SUCCESS) { + if (rtw_hal_mgnt_xmit(padapter, pmgntframe) == _SUCCESS) ret = rtw_ack_tx_wait(pxmitpriv, timeout_ms); - } pxmitpriv->ack_tx = false; mutex_unlock(>ack_tx_mutex); @@ -6431,9 +6428,8 @@ u8 setauth_hdl(struct adapter *padapter, unsigned char *pbuf) struct mlme_ext_priv *pmlmeext = >mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - if (pparm->mode < 4) { + if (pparm->mode < 4) pmlmeinfo->auth_algo = pparm->mode; - } return H2C_SUCCESS; } -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/6] staging: rtl8723bs: core: Replace NULL comparisons.
Replace NULL comparisons in the file to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 32 +-- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 00d84d34da97..ac70bbaae722 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -381,7 +381,7 @@ static void init_channel_list(struct adapter *padapter, RT_CHANNEL_INFO *channel ((BW40MINUS == o->bw) || (BW40PLUS == o->bw))) continue; - if (reg == NULL) { + if (!reg) { reg = _list->reg_class[cla]; cla++; reg->reg_class = o->op_class; @@ -659,7 +659,7 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) /* allocate a new one */ DBG_871X("going to alloc stainfo for rc ="MAC_FMT"\n", MAC_ARG(get_sa(pframe))); psta = rtw_alloc_stainfo(pstapriv, get_sa(pframe)); - if (psta == NULL) { + if (!psta) { /* TODO: */ DBG_871X(" Exceed the upper limit of supported clients...\n"); return _SUCCESS; @@ -1217,7 +1217,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) } pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); - if (pstat == NULL) { + if (!pstat) { status = _RSON_CLS2_; goto asoc_class2_error; } @@ -1377,7 +1377,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) goto OnAssocReqFail; pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS); - if (wpa_ie == NULL) { + if (!wpa_ie) { if (elems.wps_ie) { DBG_871X("STA included WPS IE in " "(Re)Association Request - assume WPS is " @@ -1943,7 +1943,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra addr = GetAddr2Ptr(pframe); psta = rtw_get_stainfo(pstapriv, addr); - if (psta == NULL) + if (!psta) return _SUCCESS; frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); @@ -2462,7 +2462,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) /* DBG_871X("%s\n", __func__); */ pmgntframe = alloc_mgtxmitframe(pxmitpriv); - if (pmgntframe == NULL) { + if (!pmgntframe) { DBG_871X("%s, alloc mgnt frame fail\n", __func__); return; } @@ -2843,7 +2843,7 @@ static int _issue_probereq(struct adapter *padapter, RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+issue_probereq\n")); pmgntframe = alloc_mgtxmitframe(pxmitpriv); - if (pmgntframe == NULL) + if (!pmgntframe) goto exit; /* update attribute */ @@ -3909,7 +3909,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch DBG_871X("%s, category =%d, action =%d, status =%d\n", __func__, category, action, status); pmgntframe = alloc_mgtxmitframe(pxmitpriv); - if (pmgntframe == NULL) + if (!pmgntframe) return; /* update attribute */ @@ -5033,12 +5033,12 @@ void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame pcmdpriv = >cmdpriv; pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); - if (pcmd_obj == NULL) + if (!pcmd_obj) return; cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header)); pevtcmd = rtw_zmalloc(cmdsz); - if (pevtcmd == NULL) { + if (!pevtcmd) { kfree(pcmd_obj); return; } @@ -5086,12 +5086,12 @@ void report_surveydone_event(struct adapter *padapter) struct cmd_priv *pcmdpriv = >cmdpriv; pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); - if (pcmd_obj == NULL) + if (!pcmd_obj) return; cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header)); pevtcmd = rtw_zmalloc(cmdsz); - if (pevtcmd == NULL) { + if (!pevtcmd) { kfree(pcmd_obj); return; } @@ -5133,12 +5133,12 @@ void report_join_res(struct adapter *padapter, int res) struct cmd_priv *pcmdpriv = >cmdpriv; pcmd_obj = rtw_zmal
[PATCH v2 1/6] staging: rtl8723bs: core: Remove blank line.
To avoid style issues, remove multiple blank lines. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index d110d4514771..00d84d34da97 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -11,7 +11,6 @@ #include #include - static struct mlme_handler mlme_sta_tbl[] = { {WIFI_ASSOCREQ, "OnAssocReq", }, {WIFI_ASSOCRSP, "OnAssocRsp", }, @@ -51,7 +50,6 @@ static struct action_handler OnAction_tbl[] = { {RTW_WLAN_CATEGORY_P2P, "ACTION_P2P", }, }; - static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; /** @@ -1261,7 +1259,6 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) goto OnAssocReqFail; } - /* now we should check all the fields... */ /* checking SSID */ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SSID_IE_, _len, @@ -3219,7 +3216,6 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i } - if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) { pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6, REALTEK_96B_IE, &(pattrib->pktlen)); } @@ -3264,7 +3260,6 @@ void issue_assocreq(struct adapter *padapter) pattrib = >attrib; update_mgntframe_attrib(padapter, pattrib); - memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/6] staging: rtl8723bs: core: Fix checkpatch warnings.
This series fix the following warnings: -Remove multiple blank lines. -Replace NULL comparison. -Remove unncessary parentheses. -Remove braces from single if statement. -Fix variable constant comparison. -Move logical operator to previous line. Changes in v2: -Dropped one patch from the series as it had some compilatin error. Vatsala Narang (6): staging: rtl8723bs: core: Remove blank line. staging: rtl8723bs: core: Replace NULL comparisons. staging: rtl8723bs: core: Remove unnecessary parentheses. staging: rtl8723bs: core: Remove braces from single if statement. staging: rtl8723bs: core: Fix variable constant comparisons. staging: rtl8723bs: core: Move logical operator to previous line. drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 69 --- 1 file changed, 30 insertions(+), 39 deletions(-) -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/7] staging: rtl8723bs: core: Fix variable constant comparisons.
Swap the terms of comparisons whenever the constant comes first to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 6f0205c9504b..2a8ae5fd1bc5 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -1276,7 +1276,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) status = _STATS_FAILURE_; } - if (_STATS_SUCCESSFUL_ != status) + if (status != _STATS_SUCCESSFUL_) goto OnAssocReqFail; /* check if the supported rate is ok */ @@ -1372,7 +1372,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) wpa_ie_len = 0; } - if (_STATS_SUCCESSFUL_ != status) + if (status != _STATS_SUCCESSFUL_) goto OnAssocReqFail; pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/7] staging: rtl8723bs: core: Remove braces from single if statement.
Remove braces from single if statement to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 60079532bddd..6f0205c9504b 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -370,9 +370,8 @@ static void init_channel_list(struct adapter *padapter, RT_CHANNEL_INFO *channel struct p2p_reg_class *reg = NULL; for (ch = o->min_chan; ch <= o->max_chan; ch += o->inc) { - if (!has_channel(channel_set, chanset_size, ch)) { + if (!has_channel(channel_set, chanset_size, ch)) continue; - } if ((0 == padapter->registrypriv.ht_enable) && (8 == o->inc)) continue; @@ -1950,9 +1949,8 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra category = frame_body[0]; if (category == RTW_WLAN_CATEGORY_BACK) {/* representing Block Ack */ - if (!pmlmeinfo->HT_enable) { + if (!pmlmeinfo->HT_enable) return _SUCCESS; - } action = frame_body[1]; DBG_871X("%s, action =%d\n", __func__, action); @@ -2397,9 +2395,8 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg pxmitpriv->ack_tx = true; pxmitpriv->seq_no = seq_no++; pmgntframe->ack_report = 1; - if (rtw_hal_mgnt_xmit(padapter, pmgntframe) == _SUCCESS) { + if (rtw_hal_mgnt_xmit(padapter, pmgntframe) == _SUCCESS) ret = rtw_ack_tx_wait(pxmitpriv, timeout_ms); - } pxmitpriv->ack_tx = false; mutex_unlock(>ack_tx_mutex); @@ -6421,9 +6418,8 @@ u8 setauth_hdl(struct adapter *padapter, unsigned char *pbuf) struct mlme_ext_priv *pmlmeext = >mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - if (pparm->mode < 4) { + if (pparm->mode < 4) pmlmeinfo->auth_algo = pparm->mode; - } return H2C_SUCCESS; } -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/7] staging: rtl8723bs: core: Moved logical operator to previous line.
Moved logical operator to previous line to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 2a8ae5fd1bc5..be48a3c043e3 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -5650,9 +5650,9 @@ static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta) ); #endif - if ((sta_rx_data_pkts(psta) == sta_last_rx_data_pkts(psta)) - && sta_rx_beacon_pkts(psta) == sta_last_rx_beacon_pkts(psta) - && sta_rx_probersp_pkts(psta) == sta_last_rx_probersp_pkts(psta) + if ((sta_rx_data_pkts(psta) == sta_last_rx_data_pkts(psta)) && + sta_rx_beacon_pkts(psta) == sta_last_rx_beacon_pkts(psta) && +sta_rx_probersp_pkts(psta) == sta_last_rx_probersp_pkts(psta) ) { ret = false; } else { -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/7] staging: rtl8723bs: core: Remove unnecessary parentheses.
Remove unnecessary parentheses after 'address-of' operator to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 32b66dce99cd..60079532bddd 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -277,7 +277,7 @@ void init_mlme_default_rate_set(struct adapter *padapter) static void init_mlme_ext_priv_value(struct adapter *padapter) { struct mlme_ext_priv *pmlmeext = >mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct mlme_ext_info *pmlmeinfo = >mlmext_info; atomic_set(>event_seq, 0); pmlmeext->mgnt_seq = 0;/* reset to zero when disconnect at client mode */ @@ -464,8 +464,8 @@ int init_mlme_ext_priv(struct adapter *padapter) int res = _SUCCESS; struct registry_priv *pregistrypriv = >registrypriv; struct mlme_ext_priv *pmlmeext = >mlmeextpriv; - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); + struct mlme_priv *pmlmepriv = >mlmepriv; + struct mlme_ext_info *pmlmeinfo = >mlmext_info; pmlmeext->padapter = padapter; @@ -609,8 +609,8 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) unsigned char *p; struct mlme_priv *pmlmepriv = >mlmepriv; struct mlme_ext_priv *pmlmeext = >mlmeextpriv; - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - struct wlan_bssid_ex*cur = &(pmlmeinfo->network); + struct mlme_ext_info *pmlmeinfo = >mlmext_info; + struct wlan_bssid_ex*cur = >network; u8 *pframe = precv_frame->u.hdr.rx_data; uint len = precv_frame->u.hdr.len; u8 is_valid_p2p_probereq = false; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/7] staging: rtl8723bs: core: Fix various checkpatch
This series fix the following warnings: -Remove multiple blank lines. -Remove return in void function. -Replace NULL comparison. -Remove unnecessary parentheses. -Remove braces from single if statement. -Fix variable constant comparison. -Move logical operator to previous line. Vatsala Narang (7): staging: rtl8723bs: core: Remove blank line. staging: rtl8723bs: core: Remove return in void function. staging: rtl8723bs: core: Replace NULL comparisons. staging: rtl8723bs: core: Remove unnecessary parentheses. staging: rtl8723bs: core: Remove braces from single if statement. staging: rtl8723bs: core: Fix variable constant comparisons. staging: rtl8723bs: core: Moved logical operator to previous line. drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 79 +++ 1 file changed, 30 insertions(+), 49 deletions(-) -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/7] staging: rtl8723bs: core: Replace NULL comparisons.
Replace NULL comparisons in the file to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 32 +-- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index a7c22e5e3559..32b66dce99cd 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -381,7 +381,7 @@ static void init_channel_list(struct adapter *padapter, RT_CHANNEL_INFO *channel ((BW40MINUS == o->bw) || (BW40PLUS == o->bw))) continue; - if (reg == NULL) { + if (!reg) { reg = _list->reg_class[cla]; cla++; reg->reg_class = o->op_class; @@ -659,7 +659,7 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) /* allocate a new one */ DBG_871X("going to alloc stainfo for rc ="MAC_FMT"\n", MAC_ARG(get_sa(pframe))); psta = rtw_alloc_stainfo(pstapriv, get_sa(pframe)); - if (psta == NULL) { + if (!psta) { /* TODO: */ DBG_871X(" Exceed the upper limit of supported clients...\n"); return _SUCCESS; @@ -1217,7 +1217,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) } pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); - if (pstat == NULL) { + if (!pstat) { status = _RSON_CLS2_; goto asoc_class2_error; } @@ -1377,7 +1377,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) goto OnAssocReqFail; pstat->flags &= ~(WLAN_STA_WPS | WLAN_STA_MAYBE_WPS); - if (wpa_ie == NULL) { + if (!wpa_ie) { if (elems.wps_ie) { DBG_871X("STA included WPS IE in " "(Re)Association Request - assume WPS is " @@ -1943,7 +1943,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra addr = GetAddr2Ptr(pframe); psta = rtw_get_stainfo(pstapriv, addr); - if (psta == NULL) + if (!psta) return _SUCCESS; frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); @@ -2462,7 +2462,7 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) /* DBG_871X("%s\n", __func__); */ pmgntframe = alloc_mgtxmitframe(pxmitpriv); - if (pmgntframe == NULL) { + if (!pmgntframe) { DBG_871X("%s, alloc mgnt frame fail\n", __func__); return; } @@ -2843,7 +2843,7 @@ static int _issue_probereq(struct adapter *padapter, RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+issue_probereq\n")); pmgntframe = alloc_mgtxmitframe(pxmitpriv); - if (pmgntframe == NULL) + if (!pmgntframe) goto exit; /* update attribute */ @@ -3907,7 +3907,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch DBG_871X("%s, category =%d, action =%d, status =%d\n", __func__, category, action, status); pmgntframe = alloc_mgtxmitframe(pxmitpriv); - if (pmgntframe == NULL) + if (!pmgntframe) return; /* update attribute */ @@ -5031,12 +5031,12 @@ void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame pcmdpriv = >cmdpriv; pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); - if (pcmd_obj == NULL) + if (!pcmd_obj) return; cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header)); pevtcmd = rtw_zmalloc(cmdsz); - if (pevtcmd == NULL) { + if (!pevtcmd) { kfree(pcmd_obj); return; } @@ -5084,12 +5084,12 @@ void report_surveydone_event(struct adapter *padapter) struct cmd_priv *pcmdpriv = >cmdpriv; pcmd_obj = rtw_zmalloc(sizeof(struct cmd_obj)); - if (pcmd_obj == NULL) + if (!pcmd_obj) return; cmdsz = (sizeof(struct surveydone_event) + sizeof(struct C2HEvent_Header)); pevtcmd = rtw_zmalloc(cmdsz); - if (pevtcmd == NULL) { + if (!pevtcmd) { kfree(pcmd_obj); return; } @@ -5131,12 +5131,12 @@ void report_join_res(struct adapter *padapter, int res) struct cmd_priv *pcmdpriv = >cmdpriv; pcmd_obj = rtw_zmal
[PATCH 2/7] staging: rtl8723bs: core: Remove return in void function.
Remove return in void function to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 00d84d34da97..a7c22e5e3559 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -3097,8 +3097,6 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short rtw_wep_encrypt(padapter, (u8 *)pmgntframe); DBG_871X("%s\n", __func__); dump_mgntframe(padapter, pmgntframe); - - return; } @@ -5271,8 +5269,6 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsi DBG_871X("report_del_sta_event: delete STA, mac_id =%d\n", mac_id); rtw_enqueue_cmd(pcmdpriv, pcmd_obj); - - return; } void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int cam_idx) @@ -5317,8 +5313,6 @@ void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int DBG_871X("report_add_sta_event: add STA\n"); rtw_enqueue_cmd(pcmdpriv, pcmd_obj); - - return; } / @@ -5828,8 +5822,6 @@ void survey_timer_hdl(struct timer_list *t) exit_survey_timer_hdl: - - return; } void link_timer_hdl(struct timer_list *t) @@ -5880,8 +5872,6 @@ void link_timer_hdl(struct timer_list *t) issue_assocreq(padapter); set_link_timer(pmlmeext, REASSOC_TO); } - - return; } void addba_timer_hdl(struct timer_list *t) -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/7] staging: rtl8723bs: core: Remove blank line.
To avoid style issues, remove multiple blank lines. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index d110d4514771..00d84d34da97 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -11,7 +11,6 @@ #include #include - static struct mlme_handler mlme_sta_tbl[] = { {WIFI_ASSOCREQ, "OnAssocReq", }, {WIFI_ASSOCRSP, "OnAssocRsp", }, @@ -51,7 +50,6 @@ static struct action_handler OnAction_tbl[] = { {RTW_WLAN_CATEGORY_P2P, "ACTION_P2P", }, }; - static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; /** @@ -1261,7 +1259,6 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) goto OnAssocReqFail; } - /* now we should check all the fields... */ /* checking SSID */ p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SSID_IE_, _len, @@ -3219,7 +3216,6 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i } - if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) { pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6, REALTEK_96B_IE, &(pattrib->pktlen)); } @@ -3264,7 +3260,6 @@ void issue_assocreq(struct adapter *padapter) pattrib = >attrib; update_mgntframe_attrib(padapter, pattrib); - memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: core: Prefer using the BIT Macro.
Replace bit shifting on 1 with the BIT(x) macro. Issue found using coccinelle. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index d4842ba64951..d110d4514771 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -1981,7 +1981,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra if (status == 0) { /* successful */ DBG_871X("agg_enable for TID =%d\n", tid); - psta->htpriv.agg_enable_bitmap |= 1 << tid; + psta->htpriv.agg_enable_bitmap |= BIT(tid); psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); } else { psta->htpriv.agg_enable_bitmap &= ~BIT(tid); @@ -1999,8 +1999,10 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra case RTW_WLAN_ACTION_DELBA: /* DELBA */ if ((frame_body[3] & BIT(3)) == 0) { - psta->htpriv.agg_enable_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf)); - psta->htpriv.candidate_tid_bitmap &= ~(1 << ((frame_body[3] >> 4) & 0xf)); + psta->htpriv.agg_enable_bitmap &= + ~BIT((frame_body[3] >> 4) & 0xf); + psta->htpriv.candidate_tid_bitmap &= + ~BIT((frame_body[3] >> 4) & 0xf); /* reason_code = frame_body[4] | (frame_body[5] << 8); */ reason_code = RTW_GET_LE16(_body[4]); -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: core: Use !x in place of NULL comparison.
Avoid NULL comparison, compare using boolean operator. Issue found using coccinelle. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_io.c | 2 +- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c index d341069097e2..a92bc19b196a 100644 --- a/drivers/staging/rtl8723bs/core/rtw_io.c +++ b/drivers/staging/rtl8723bs/core/rtw_io.c @@ -156,7 +156,7 @@ int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapt struct io_priv *piopriv = >iopriv; struct intf_hdl *pintf = >intf; - if (set_intf_ops == NULL) + if (!set_intf_ops) return _FAIL; piopriv->padapter = padapter; diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c index 67b8840ee2fd..bdc52d8d5625 100644 --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c @@ -316,7 +316,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) struct sta_priv *pstapriv = >stapriv; struct hw_xmit *phwxmit; - if (psta == NULL) + if (!psta) goto exit; @@ -520,7 +520,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) u8 *addr; u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - if (hwaddr == NULL) + if (!hwaddr) return NULL; if (IS_MCAST(hwaddr)) @@ -565,7 +565,7 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter) psta = rtw_alloc_stainfo(pstapriv, bcast_addr); - if (psta == NULL) { + if (!psta) { res = _FAIL; RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("rtw_alloc_stainfo fail")); goto exit; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: iio: adc: Add paragraph to describe Kconfig symbol
This patch updates Kconfig with paragraph that describe config symbol fully.Issue addressed by checkpatch. Signed-off-by: Vatsala Narang --- drivers/staging/iio/adc/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig index 23d9a655a520..31cd9a12f40f 100644 --- a/drivers/staging/iio/adc/Kconfig +++ b/drivers/staging/iio/adc/Kconfig @@ -12,6 +12,9 @@ config AD7816 Say yes here to build support for Analog Devices AD7816/7/8 temperature sensors and ADC. + To compile this driver as a module, choose M here: the + module will be called ad7816. + config AD7192 tristate "Analog Devices AD7190 AD7192 AD7193 AD7195 ADC driver" depends on SPI -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: vc04_services: bcm2835-camera: Compress two lines into one line
Return value directly without saving it in a variable and remove that variable. Issue suggested by Coccinelle. Signed-off-by: Vatsala Narang --- Changes in v2: -Change subject line and log message -Remove respective unused variable drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index c9b6346111a5..68f08dc18da9 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -1491,7 +1491,6 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance, struct vchiq_mmal_component *camera, struct bm2835_mmal_dev *dev) { - int ret; struct mmal_parameter_camera_config cam_config = { .max_stills_w = dev->max_width, .max_stills_h = dev->max_height, @@ -1507,10 +1506,9 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance, .use_stc_timestamp = MMAL_PARAM_TIMESTAMP_MODE_RAW_STC }; - ret = vchiq_mmal_port_parameter_set(instance, >control, + return vchiq_mmal_port_parameter_set(instance, >control, MMAL_PARAMETER_CAMERA_CONFIG, _config, sizeof(cam_config)); - return ret; } #define MAX_SUPPORTED_ENCODINGS 20 -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: vc04_services: bcm2835-camera: Modify return statement.
Modify return statement and remove the respective assignment. Issue found by coccinelle. Signed-off-by: Vatsala Narang --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index c9b6346111a5..cef6d5b758e8 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -1507,10 +1507,9 @@ static int set_camera_parameters(struct vchiq_mmal_instance *instance, .use_stc_timestamp = MMAL_PARAM_TIMESTAMP_MODE_RAW_STC }; - ret = vchiq_mmal_port_parameter_set(instance, >control, + return vchiq_mmal_port_parameter_set(instance, >control, MMAL_PARAMETER_CAMERA_CONFIG, _config, sizeof(cam_config)); - return ret; } #define MAX_SUPPORTED_ENCODINGS 20 -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: core: Remove blank line.
To avoid style issues, remove multiple blank lines. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c index 2474fa6fb49b..67b8840ee2fd 100644 --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c @@ -75,7 +75,6 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) psta = (struct sta_info *)(pstapriv->pstainfo_buf); - for (i = 0; i < NUM_STA; i++) { _rtw_init_stainfo(psta); @@ -393,7 +392,6 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) ); pstapriv->asoc_sta_count--; - /* re-init sta_info; 20061114 will be init in alloc_stainfo */ /* _rtw_init_sta_xmit_priv(>sta_xmitpriv); */ /* _rtw_init_sta_recv_priv(>sta_recvpriv); */ @@ -436,7 +434,6 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) if (!(psta->state & WIFI_AP_STATE)) rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, false); - /* release mac id for non-bc/mc station, */ rtw_release_macid(pstapriv->padapter, psta); @@ -582,7 +579,6 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter) return _SUCCESS; } - struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter) { struct sta_priv *pstapriv = >stapriv; @@ -617,7 +613,6 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr) } spin_unlock_bh(&(pacl_node_q->lock)); - if (pacl_list->mode == 1) /* accept unless in deny list */ res = !match; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: core: Remove else after return statement.
Remove else after return statement as it is not useful. Issue found using checkpatch. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index c6ae29b3e599..d4842ba64951 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -697,10 +697,9 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) psta->aid = 0; DBG_871X("no room for more AIDs\n"); return _SUCCESS; - } else { - pstapriv->sta_aid[psta->aid - 1] = psta; - DBG_871X("allocate new AID = (%d)\n", psta->aid); } + pstapriv->sta_aid[psta->aid - 1] = psta; + DBG_871X("allocate new AID = (%d)\n", psta->aid); } psta->qos_option = 1; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: rtl8723bs: core: Remove else after return statement.
Remove else after return statement as it is not useful. Issue found using checkpatch. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index c6ae29b3e599..d4842ba64951 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -697,10 +697,9 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame) psta->aid = 0; DBG_871X("no room for more AIDs\n"); return _SUCCESS; - } else { - pstapriv->sta_aid[psta->aid - 1] = psta; - DBG_871X("allocate new AID = (%d)\n", psta->aid); } + pstapriv->sta_aid[psta->aid - 1] = psta; + DBG_871X("allocate new AID = (%d)\n", psta->aid); } psta->qos_option = 1; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: vc04_services: bcm2835-camera: Modify return statement.
Modify return statement and remove the respective assignment. Issue found by Coccinelle. Signed-off-by: Vatsala Narang --- drivers/staging/vc04_services/bcm2835-camera/controls.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index 2e0a422cdf3e..9841c30450ce 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -270,11 +270,9 @@ static int ctrl_set_rotate(struct bm2835_mmal_dev *dev, if (ret < 0) return ret; - ret = vchiq_mmal_port_parameter_set(dev->instance, >output[2], + return vchiq_mmal_port_parameter_set(dev->instance, >output[2], mmal_ctrl->mmal_id, _value, sizeof(u32_value)); - - return ret; } static int ctrl_set_flip(struct bm2835_mmal_dev *dev, @@ -313,11 +311,9 @@ static int ctrl_set_flip(struct bm2835_mmal_dev *dev, if (ret < 0) return ret; - ret = vchiq_mmal_port_parameter_set(dev->instance, >output[2], + return vchiq_mmal_port_parameter_set(dev->instance, >output[2], mmal_ctrl->mmal_id, _value, sizeof(u32_value)); - - return ret; } static int ctrl_set_exposure(struct bm2835_mmal_dev *dev, -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: rtl8192u: ieee80211: Fix spelling mistake
Replace explicitely with explicitly to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- Changes in v2: -added this patch to patchset to fix spelling mistake. drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 2044ae27b973..9631331b79d5 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -396,7 +396,8 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, (*crypt)->priv); sec.flags |= BIT(key); /* This ensures a key will be activated if no key is -* explicitely set */ +* explicitly set +*/ if (key == sec.active_key) sec.flags |= SEC_ACTIVE_KEY; ieee->tx_keyidx = key; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro
Change suggested by coccinelle. Replace bit shifting on 1 with the BIT(x) macro. Coccinelle script: @@ expression c; @@ -(1 << c) +BIT(c) Signed-off-by: Vatsala Narang --- Changes in v2: -changed log message -added space around '&' opreator and after 'if' -added another patch to fix spelling mistake drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index fa59c712c74b..2044ae27b973 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -86,7 +86,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, /* Add the protocol name */ iwe.cmd = SIOCGIWNAME; for(i=0; imode&(1<mode & BIT(i)) { sprintf(pname,ieee80211_modes[i].mode_string,ieee80211_modes[i].mode_size); pname +=ieee80211_modes[i].mode_size; } @@ -394,7 +394,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, sec.key_sizes[key] = len; (*crypt)->ops->set_key(sec.keys[key], len, NULL, (*crypt)->priv); - sec.flags |= (1 << key); + sec.flags |= BIT(key); /* This ensures a key will be activated if no key is * explicitely set */ if (key == sec.active_key) @@ -415,7 +415,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, (*crypt)->ops->set_key(sec.keys[key], 13, NULL, (*crypt)->priv); sec.key_sizes[key] = 13; - sec.flags |= (1 << key); + sec.flags |= BIT(key); } /* No key data - just set the default TX key index */ @@ -636,7 +636,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, if (ext->alg != IW_ENCODE_ALG_NONE) { //memcpy(sec.keys[idx], ext->key, ext->key_len); sec.key_sizes[idx] = ext->key_len; - sec.flags |= (1 << idx); + sec.flags |= BIT(idx); if (ext->alg == IW_ENCODE_ALG_WEP) { // sec.encode_alg[idx] = SEC_ALG_WEP; sec.flags |= SEC_LEVEL; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: core: Remove return in void function
Remove return in void function to get rid of checkpatch warning. Signed-off-by: Vatsala Narang --- drivers/staging/rtl8723bs/core/rtw_xmit.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index 094d61bcb469..67b9aeda7f3a 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -2861,8 +2861,6 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst /* spin_unlock_bh(>sleep_q.lock); */ spin_unlock_bh(>lock); - - return; } void enqueue_pending_xmitbuf( -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro
Challenge suggested by coccinelle. Replace bit shifting on 1 with the BIT(x) macro. Coccinelle script: @@ expression c; @@ -(1 << c) +BIT(c) Signed-off-by: Vatsala Narang --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index fa59c712c74b..c44662f03a6b 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -86,7 +86,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, /* Add the protocol name */ iwe.cmd = SIOCGIWNAME; for(i=0; imode&(1<mode(i)) { sprintf(pname,ieee80211_modes[i].mode_string,ieee80211_modes[i].mode_size); pname +=ieee80211_modes[i].mode_size; } @@ -394,7 +394,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, sec.key_sizes[key] = len; (*crypt)->ops->set_key(sec.keys[key], len, NULL, (*crypt)->priv); - sec.flags |= (1 << key); + sec.flags |= BIT(key); /* This ensures a key will be activated if no key is * explicitely set */ if (key == sec.active_key) @@ -415,7 +415,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, (*crypt)->ops->set_key(sec.keys[key], 13, NULL, (*crypt)->priv); sec.key_sizes[key] = 13; - sec.flags |= (1 << key); + sec.flags |= BIT(key); } /* No key data - just set the default TX key index */ @@ -636,7 +636,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, if (ext->alg != IW_ENCODE_ALG_NONE) { //memcpy(sec.keys[idx], ext->key, ext->key_len); sec.key_sizes[idx] = ext->key_len; - sec.flags |= (1 << idx); + sec.flags |= BIT(idx); if (ext->alg == IW_ENCODE_ALG_WEP) { // sec.encode_alg[idx] = SEC_ALG_WEP; sec.flags |= SEC_LEVEL; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel