2019-06-14 02:13:59

by Shobhit Kukreti

[permalink] [raw]
Subject: [PATCH] staging: rtl8723bs: Resolve checkpatch error "that open brace { should be on the previous line" in the rtl8723bs driver

Cleaned up the code from the following files to get rid of
check patch error "that open brace { should be on the previous line"

drivers/staging/rtl8723bs/os_dep/mlme_linux.c
drivers/staging/rtl8723bs/os_dep/recv_linux.c
drivers/staging/rtl8723bs/os_dep/rtw_proc.c
drivers/staging/rtl8723bs/os_dep/sdio_intf.c
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c

Signed-off-by: Shobhit Kukreti <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 14 ++---
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 76 ++++++++---------------
drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 6 +-
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 15 ++---
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c | 24 +++----
5 files changed, 47 insertions(+), 88 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
index aa2499f..6799ed4 100644
--- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
@@ -46,8 +46,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);

if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
- (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
- {
+ (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
rtw_cfg80211_ibss_indicate_connect(adapter);
}
else
@@ -77,8 +76,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)

spin_lock_bh(&adapter->security_key_mutex);

- if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)/* 802.1x */
- {
+ if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { /* 802.1x */
+
/* Added by Albert 2009/02/18 */
/* We have to backup the PMK information for WiFi PMK Caching test item. */
/* */
@@ -106,8 +105,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;

}
- else /* reset values in securitypriv */
- {
+ else { /* reset values in securitypriv */
+
/* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
/* */
struct security_priv *psec_priv = &adapter->securitypriv;
@@ -150,8 +149,7 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
RT_TRACE(_module_mlme_osdep_c_, _drv_info_, ("+rtw_report_sec_ie, authmode =%d\n", authmode));

buff = NULL;
- if (authmode == _WPA_IE_ID_)
- {
+ if (authmode == _WPA_IE_ID_) {
RT_TRACE(_module_mlme_osdep_c_, _drv_info_, ("rtw_report_sec_ie, authmode =%d\n", authmode));

buff = rtw_zmalloc(IW_CUSTOM_MAX);
diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index 3fe9c22..44a8920 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -12,8 +12,7 @@

void rtw_os_free_recvframe(union recv_frame *precvframe)
{
- if (precvframe->u.hdr.pkt)
- {
+ if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */

precvframe->u.hdr.pkt = NULL;
@@ -34,10 +33,8 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)

precvframe = (union recv_frame*) precvpriv->precv_frame_buf;

- for (i = 0; i < NR_RECVFRAME; i++)
- {
- if (precvframe->u.hdr.pkt)
- {
+ for (i = 0; i < NR_RECVFRAME; i++) {
+ if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
precvframe->u.hdr.pkt = NULL;
}
@@ -48,8 +45,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
/* free os related resource in struct recv_buf */
void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf)
{
- if (precvbuf->pskb)
- {
+ if (precvbuf->pskb) {
dev_kfree_skb_any(precvbuf->pskb);
}
}
@@ -63,22 +59,18 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
pattrib = &prframe->u.hdr.attrib;

sub_skb = rtw_skb_alloc(nSubframe_Length + 12);
- if (sub_skb)
- {
+ if (sub_skb) {
skb_reserve(sub_skb, 12);
skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
}
- else
- {
+ else {
sub_skb = rtw_skb_clone(prframe->u.hdr.pkt);
- if (sub_skb)
- {
+ if (sub_skb) {
sub_skb->data = pdata + ETH_HLEN;
sub_skb->len = nSubframe_Length;
skb_set_tail_pointer(sub_skb, nSubframe_Length);
}
- else
- {
+ else {
DBG_871X("%s(): rtw_skb_clone() Fail!!!\n", __func__);
return NULL;
}
@@ -113,8 +105,7 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt

/* Indicat the packets to upper layer */
if (pkt) {
- if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
- {
+ if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
_pkt *pskb2 = NULL;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
@@ -122,20 +113,17 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt

/* DBG_871X("bmcast =%d\n", bmcast); */

- if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN))
- {
+ if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)) {
/* DBG_871X("not ap psta =%p, addr =%pM\n", psta, pattrib->dst); */

- if (bmcast)
- {
+ if (bmcast) {
psta = rtw_get_bcmc_stainfo(padapter);
pskb2 = rtw_skb_clone(pkt);
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
}

- if (psta)
- {
+ if (psta) {
struct net_device *pnetdev = (struct net_device*)padapter->pnetdev;

/* DBG_871X("directly forwarding to the rtw_xmit_entry\n"); */
@@ -155,8 +143,8 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt
}
}
}
- else/* to APself */
- {
+ else { /* to APself */
+
/* DBG_871X("to APSelf\n"); */
DBG_COUNTER(padapter->rx_logs.os_indicate_ap_self);
}
@@ -192,32 +180,26 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
struct security_priv *psecuritypriv = &padapter->securitypriv;
unsigned long cur_time = 0;

- if (psecuritypriv->last_mic_err_time == 0)
- {
+ if (psecuritypriv->last_mic_err_time == 0) {
psecuritypriv->last_mic_err_time = jiffies;
}
- else
- {
+ else {
cur_time = jiffies;

- if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ)
- {
+ if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) {
psecuritypriv->btkip_countermeasure = true;
psecuritypriv->last_mic_err_time = 0;
psecuritypriv->btkip_countermeasure_time = cur_time;
}
- else
- {
+ else {
psecuritypriv->last_mic_err_time = jiffies;
}
}

- if (bgroup)
- {
+ if (bgroup) {
key_type |= NL80211_KEYTYPE_GROUP;
}
- else
- {
+ else {
key_type |= NL80211_KEYTYPE_PAIRWISE;
}

@@ -225,12 +207,10 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
NULL, GFP_ATOMIC);

memset(&ev, 0x00, sizeof(ev));
- if (bgroup)
- {
+ if (bgroup) {
ev.flags |= IW_MICFAILURE_GROUP;
}
- else
- {
+ else {
ev.flags |= IW_MICFAILURE_PAIRWISE;
}

@@ -250,8 +230,7 @@ static void rtw_os_ksocket_send(struct adapter *padapter, union recv_frame *prec

DBG_871X("eth rx: got eth_type = 0x%x\n", pattrib->eth_type);

- if (psta && psta->isrc && psta->pid>0)
- {
+ if (psta && psta->isrc && psta->pid>0) {
u16 rx_pid;

rx_pid = *(u16*)(skb->data+ETH_HLEN);
@@ -259,8 +238,7 @@ static void rtw_os_ksocket_send(struct adapter *padapter, union recv_frame *prec
DBG_871X("eth rx(pid = 0x%x): sta("MAC_FMT") pid = 0x%x\n",
rx_pid, MAC_ARG(psta->hwaddr), psta->pid);

- if (rx_pid == psta->pid)
- {
+ if (rx_pid == psta->pid) {
int i;
u16 len = *(u16*)(skb->data+ETH_HLEN+2);
/* u16 ctrl_type = *(u16*)(skb->data+ETH_HLEN+4); */
@@ -293,8 +271,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
pfree_recv_queue = &(precvpriv->free_recv_queue);

skb = precv_frame->u.hdr.pkt;
- if (skb == NULL)
- {
+ if (skb == NULL) {
RT_TRACE(_module_recv_osdep_c_, _drv_err_, ("rtw_recv_indicatepkt():skb == NULL something wrong!!!!\n"));
goto _recv_indicatepkt_drop;
}
@@ -312,8 +289,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("\n skb->head =%p skb->data =%p skb->tail =%p skb->end =%p skb->len =%d\n", skb->head, skb->data, skb_tail_pointer(skb), skb_end_pointer(skb), skb->len));

#ifdef CONFIG_AUTO_AP_MODE
- if (0x8899 == pattrib->eth_type)
- {
+ if (0x8899 == pattrib->eth_type) {
rtw_os_ksocket_send(padapter, precv_frame);

/* goto _recv_indicatepkt_drop; */
diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
index d6862e8..5f950fd 100644
--- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
+++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
@@ -63,8 +63,7 @@ static ssize_t proc_set_log_level(struct file *file, const char __user *buffer,

if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
sscanf(tmp, "%d ", &log_level);
- if (log_level >= _drv_always_ && log_level <= _drv_debug_)
- {
+ if (log_level >= _drv_always_ && log_level <= _drv_debug_) {
GlobalDebugLevel = log_level;
printk("%d\n", GlobalDebugLevel);
}
@@ -224,8 +223,7 @@ static ssize_t proc_set_linked_info_dump(struct file *file, const char __user *b
return -EFAULT;

if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
- if (padapter)
- {
+ if (padapter) {
/* padapter->bLinkInfoDump = mode; */
/* DBG_871X("linked_info_dump =%s\n", (padapter->bLinkInfoDump)?"enable":"disable"); */
linked_info_dump(padapter, mode);
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 101a22f..c60f13c 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -85,13 +85,11 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)
sdio_claim_host(func);

err = sdio_claim_irq(func, &sd_sync_int_hdl);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_alloc_irq_error_cnt++;
printk(KERN_CRIT "%s: sdio_claim_irq FAIL(%d)!\n", __func__, err);
}
- else
- {
+ else {
dvobj->drv_dbg.dbg_sdio_alloc_irq_cnt++;
dvobj->irq_alloc = 1;
}
@@ -114,8 +112,7 @@ static void sdio_free_irq(struct dvobj_priv *dvobj)
if (func) {
sdio_claim_host(func);
err = sdio_release_irq(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_871X_LEVEL(_drv_err_,"%s: sdio_release_irq FAIL(%d)!\n", __func__, err);
}
@@ -225,16 +222,14 @@ static void sdio_deinit(struct dvobj_priv *dvobj)
if (func) {
sdio_claim_host(func);
err = sdio_disable_func(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_deinit_error_cnt++;
DBG_8192C(KERN_ERR "%s: sdio_disable_func(%d)\n", __func__, err);
}

if (dvobj->irq_alloc) {
err = sdio_release_irq(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_8192C(KERN_ERR "%s: sdio_release_irq(%d)\n", __func__, err);
}
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
index 1787534..50b8934 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
@@ -257,15 +257,13 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
if (claim_needed)
sdio_release_host(func);

- if (err && *err)
- {
+ if (err && *err) {
int i;

DBG_871X(KERN_ERR "%s: (%d) addr = 0x%05x, val = 0x%x\n", __func__, *err, addr, v);

*err = 0;
- for (i = 0; i < SD_IO_TRY_CNT; i++)
- {
+ for (i = 0; i < SD_IO_TRY_CNT; i++) {
if (claim_needed) sdio_claim_host(func);
v = sdio_readl(func, addr, err);
if (claim_needed) sdio_release_host(func);
@@ -350,15 +348,13 @@ void sd_write32(struct intf_hdl *pintfhdl, u32 addr, u32 v, s32 *err)
if (claim_needed)
sdio_release_host(func);

- if (err && *err)
- {
+ if (err && *err) {
int i;

DBG_871X(KERN_ERR "%s: (%d) addr = 0x%05x val = 0x%08x\n", __func__, *err, addr, v);

*err = 0;
- for (i = 0; i < SD_IO_TRY_CNT; i++)
- {
+ for (i = 0; i < SD_IO_TRY_CNT; i++) {
if (claim_needed) sdio_claim_host(func);
sdio_writel(func, v, addr, err);
if (claim_needed) sdio_release_host(func);
@@ -420,13 +416,11 @@ s32 _sd_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata)

func = psdio->func;

- if (unlikely((cnt == 1) || (cnt == 2)))
- {
+ if (unlikely((cnt == 1) || (cnt == 2))) {
int i;
u8 *pbuf = pdata;

- for (i = 0; i < cnt; i++)
- {
+ for (i = 0; i < cnt; i++) {
*(pbuf+i) = sdio_readb(func, addr+i, &err);

if (err) {
@@ -523,13 +517,11 @@ s32 _sd_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata)
func = psdio->func;
/* size = sdio_align_size(func, cnt); */

- if (unlikely((cnt == 1) || (cnt == 2)))
- {
+ if (unlikely((cnt == 1) || (cnt == 2))) {
int i;
u8 *pbuf = pdata;

- for (i = 0; i < cnt; i++)
- {
+ for (i = 0; i < cnt; i++) {
sdio_writeb(func, *(pbuf+i), addr+i, &err);
if (err) {
DBG_871X(KERN_ERR "%s: FAIL!(%d) addr = 0x%05x val = 0x%02x\n", __func__, err, addr, *(pbuf+i));
--
2.7.4


2019-06-15 18:55:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging: rtl8723bs: Resolve checkpatch error "that open brace { should be on the previous line" in the rtl8723bs driver

On Thu, Jun 13, 2019 at 07:12:10PM -0700, Shobhit Kukreti wrote:
> Cleaned up the code from the following files to get rid of
> check patch error "that open brace { should be on the previous line"
>
> drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> drivers/staging/rtl8723bs/os_dep/recv_linux.c
> drivers/staging/rtl8723bs/os_dep/rtw_proc.c
> drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
>
> Signed-off-by: Shobhit Kukreti <[email protected]>
> ---
> drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 14 ++---
> drivers/staging/rtl8723bs/os_dep/recv_linux.c | 76 ++++++++---------------
> drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 6 +-
> drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 15 ++---
> drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c | 24 +++----
> 5 files changed, 47 insertions(+), 88 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> index aa2499f..6799ed4 100644
> --- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> +++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> @@ -46,8 +46,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
> struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
>
> if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
> - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
> - {
> + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
> rtw_cfg80211_ibss_indicate_connect(adapter);
> }
> else
> @@ -77,8 +76,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)
>
> spin_lock_bh(&adapter->security_key_mutex);
>
> - if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)/* 802.1x */
> - {
> + if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { /* 802.1x */
> +
> /* Added by Albert 2009/02/18 */
> /* We have to backup the PMK information for WiFi PMK Caching test item. */
> /* */
> @@ -106,8 +105,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)
> adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
>
> }
> - else /* reset values in securitypriv */
> - {
> + else { /* reset values in securitypriv */
> +

Trailing whitespace?

The comment should be on a new line, not on the same line.

thanks,

greg k-h

2019-06-15 21:30:32

by Shobhit Kukreti

[permalink] [raw]
Subject: [PATCH v2] staging: rtl8723bs: Resolve checkpatch error "that open brace { should be on the previous line" in the rtl8723 driver

Cleaned up the code from the following files to get rid of
check patch error "that open brace { should be on the previous line"

drivers/staging/rtl8723bs/os_dep/mlme_linux.c
drivers/staging/rtl8723bs/os_dep/recv_linux.c
drivers/staging/rtl8723bs/os_dep/rtw_proc.c
drivers/staging/rtl8723bs/os_dep/sdio_intf.c
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c

Signed-off-by: Shobhit Kukreti <[email protected]>
---
Changes in v2:
- Removed Trailing whitespace introduced in the previous patch
- Moved comments to a new line

drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 15 +++--
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 77 ++++++++---------------
drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 6 +-
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 15 ++---
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c | 24 +++----
5 files changed, 49 insertions(+), 88 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
index aa2499f..4631b68 100644
--- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
@@ -46,8 +46,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);

if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
- (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
- {
+ (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
rtw_cfg80211_ibss_indicate_connect(adapter);
}
else
@@ -77,8 +76,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)

spin_lock_bh(&adapter->security_key_mutex);

- if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)/* 802.1x */
- {
+ if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { /* 802.1x */
+
/* Added by Albert 2009/02/18 */
/* We have to backup the PMK information for WiFi PMK Caching test item. */
/* */
@@ -106,8 +105,9 @@ void rtw_reset_securitypriv(struct adapter *adapter)
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;

}
- else /* reset values in securitypriv */
- {
+ else {
+ /* reset values in securitypriv */
+
/* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
/* */
struct security_priv *psec_priv = &adapter->securitypriv;
@@ -150,8 +150,7 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
RT_TRACE(_module_mlme_osdep_c_, _drv_info_, ("+rtw_report_sec_ie, authmode =%d\n", authmode));

buff = NULL;
- if (authmode == _WPA_IE_ID_)
- {
+ if (authmode == _WPA_IE_ID_) {
RT_TRACE(_module_mlme_osdep_c_, _drv_info_, ("rtw_report_sec_ie, authmode =%d\n", authmode));

buff = rtw_zmalloc(IW_CUSTOM_MAX);
diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index 3fe9c22..a2055f6 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -12,8 +12,7 @@

void rtw_os_free_recvframe(union recv_frame *precvframe)
{
- if (precvframe->u.hdr.pkt)
- {
+ if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */

precvframe->u.hdr.pkt = NULL;
@@ -34,10 +33,8 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)

precvframe = (union recv_frame*) precvpriv->precv_frame_buf;

- for (i = 0; i < NR_RECVFRAME; i++)
- {
- if (precvframe->u.hdr.pkt)
- {
+ for (i = 0; i < NR_RECVFRAME; i++) {
+ if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
precvframe->u.hdr.pkt = NULL;
}
@@ -48,8 +45,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
/* free os related resource in struct recv_buf */
void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf)
{
- if (precvbuf->pskb)
- {
+ if (precvbuf->pskb) {
dev_kfree_skb_any(precvbuf->pskb);
}
}
@@ -63,22 +59,18 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
pattrib = &prframe->u.hdr.attrib;

sub_skb = rtw_skb_alloc(nSubframe_Length + 12);
- if (sub_skb)
- {
+ if (sub_skb) {
skb_reserve(sub_skb, 12);
skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
}
- else
- {
+ else {
sub_skb = rtw_skb_clone(prframe->u.hdr.pkt);
- if (sub_skb)
- {
+ if (sub_skb) {
sub_skb->data = pdata + ETH_HLEN;
sub_skb->len = nSubframe_Length;
skb_set_tail_pointer(sub_skb, nSubframe_Length);
}
- else
- {
+ else {
DBG_871X("%s(): rtw_skb_clone() Fail!!!\n", __func__);
return NULL;
}
@@ -113,8 +105,7 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt

/* Indicat the packets to upper layer */
if (pkt) {
- if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
- {
+ if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
_pkt *pskb2 = NULL;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
@@ -122,20 +113,17 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt

/* DBG_871X("bmcast =%d\n", bmcast); */

- if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN))
- {
+ if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)) {
/* DBG_871X("not ap psta =%p, addr =%pM\n", psta, pattrib->dst); */

- if (bmcast)
- {
+ if (bmcast) {
psta = rtw_get_bcmc_stainfo(padapter);
pskb2 = rtw_skb_clone(pkt);
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
}

- if (psta)
- {
+ if (psta) {
struct net_device *pnetdev = (struct net_device*)padapter->pnetdev;

/* DBG_871X("directly forwarding to the rtw_xmit_entry\n"); */
@@ -155,8 +143,9 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt
}
}
}
- else/* to APself */
- {
+ else {
+ /* to APself */
+
/* DBG_871X("to APSelf\n"); */
DBG_COUNTER(padapter->rx_logs.os_indicate_ap_self);
}
@@ -192,32 +181,26 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
struct security_priv *psecuritypriv = &padapter->securitypriv;
unsigned long cur_time = 0;

- if (psecuritypriv->last_mic_err_time == 0)
- {
+ if (psecuritypriv->last_mic_err_time == 0) {
psecuritypriv->last_mic_err_time = jiffies;
}
- else
- {
+ else {
cur_time = jiffies;

- if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ)
- {
+ if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) {
psecuritypriv->btkip_countermeasure = true;
psecuritypriv->last_mic_err_time = 0;
psecuritypriv->btkip_countermeasure_time = cur_time;
}
- else
- {
+ else {
psecuritypriv->last_mic_err_time = jiffies;
}
}

- if (bgroup)
- {
+ if (bgroup) {
key_type |= NL80211_KEYTYPE_GROUP;
}
- else
- {
+ else {
key_type |= NL80211_KEYTYPE_PAIRWISE;
}

@@ -225,12 +208,10 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
NULL, GFP_ATOMIC);

memset(&ev, 0x00, sizeof(ev));
- if (bgroup)
- {
+ if (bgroup) {
ev.flags |= IW_MICFAILURE_GROUP;
}
- else
- {
+ else {
ev.flags |= IW_MICFAILURE_PAIRWISE;
}

@@ -250,8 +231,7 @@ static void rtw_os_ksocket_send(struct adapter *padapter, union recv_frame *prec

DBG_871X("eth rx: got eth_type = 0x%x\n", pattrib->eth_type);

- if (psta && psta->isrc && psta->pid>0)
- {
+ if (psta && psta->isrc && psta->pid>0) {
u16 rx_pid;

rx_pid = *(u16*)(skb->data+ETH_HLEN);
@@ -259,8 +239,7 @@ static void rtw_os_ksocket_send(struct adapter *padapter, union recv_frame *prec
DBG_871X("eth rx(pid = 0x%x): sta("MAC_FMT") pid = 0x%x\n",
rx_pid, MAC_ARG(psta->hwaddr), psta->pid);

- if (rx_pid == psta->pid)
- {
+ if (rx_pid == psta->pid) {
int i;
u16 len = *(u16*)(skb->data+ETH_HLEN+2);
/* u16 ctrl_type = *(u16*)(skb->data+ETH_HLEN+4); */
@@ -293,8 +272,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
pfree_recv_queue = &(precvpriv->free_recv_queue);

skb = precv_frame->u.hdr.pkt;
- if (skb == NULL)
- {
+ if (skb == NULL) {
RT_TRACE(_module_recv_osdep_c_, _drv_err_, ("rtw_recv_indicatepkt():skb == NULL something wrong!!!!\n"));
goto _recv_indicatepkt_drop;
}
@@ -312,8 +290,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("\n skb->head =%p skb->data =%p skb->tail =%p skb->end =%p skb->len =%d\n", skb->head, skb->data, skb_tail_pointer(skb), skb_end_pointer(skb), skb->len));

#ifdef CONFIG_AUTO_AP_MODE
- if (0x8899 == pattrib->eth_type)
- {
+ if (0x8899 == pattrib->eth_type) {
rtw_os_ksocket_send(padapter, precv_frame);

/* goto _recv_indicatepkt_drop; */
diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
index d6862e8..5f950fd 100644
--- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
+++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
@@ -63,8 +63,7 @@ static ssize_t proc_set_log_level(struct file *file, const char __user *buffer,

if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
sscanf(tmp, "%d ", &log_level);
- if (log_level >= _drv_always_ && log_level <= _drv_debug_)
- {
+ if (log_level >= _drv_always_ && log_level <= _drv_debug_) {
GlobalDebugLevel = log_level;
printk("%d\n", GlobalDebugLevel);
}
@@ -224,8 +223,7 @@ static ssize_t proc_set_linked_info_dump(struct file *file, const char __user *b
return -EFAULT;

if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
- if (padapter)
- {
+ if (padapter) {
/* padapter->bLinkInfoDump = mode; */
/* DBG_871X("linked_info_dump =%s\n", (padapter->bLinkInfoDump)?"enable":"disable"); */
linked_info_dump(padapter, mode);
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 101a22f..c60f13c 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -85,13 +85,11 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)
sdio_claim_host(func);

err = sdio_claim_irq(func, &sd_sync_int_hdl);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_alloc_irq_error_cnt++;
printk(KERN_CRIT "%s: sdio_claim_irq FAIL(%d)!\n", __func__, err);
}
- else
- {
+ else {
dvobj->drv_dbg.dbg_sdio_alloc_irq_cnt++;
dvobj->irq_alloc = 1;
}
@@ -114,8 +112,7 @@ static void sdio_free_irq(struct dvobj_priv *dvobj)
if (func) {
sdio_claim_host(func);
err = sdio_release_irq(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_871X_LEVEL(_drv_err_,"%s: sdio_release_irq FAIL(%d)!\n", __func__, err);
}
@@ -225,16 +222,14 @@ static void sdio_deinit(struct dvobj_priv *dvobj)
if (func) {
sdio_claim_host(func);
err = sdio_disable_func(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_deinit_error_cnt++;
DBG_8192C(KERN_ERR "%s: sdio_disable_func(%d)\n", __func__, err);
}

if (dvobj->irq_alloc) {
err = sdio_release_irq(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_8192C(KERN_ERR "%s: sdio_release_irq(%d)\n", __func__, err);
}
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
index 1787534..50b8934 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
@@ -257,15 +257,13 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
if (claim_needed)
sdio_release_host(func);

- if (err && *err)
- {
+ if (err && *err) {
int i;

DBG_871X(KERN_ERR "%s: (%d) addr = 0x%05x, val = 0x%x\n", __func__, *err, addr, v);

*err = 0;
- for (i = 0; i < SD_IO_TRY_CNT; i++)
- {
+ for (i = 0; i < SD_IO_TRY_CNT; i++) {
if (claim_needed) sdio_claim_host(func);
v = sdio_readl(func, addr, err);
if (claim_needed) sdio_release_host(func);
@@ -350,15 +348,13 @@ void sd_write32(struct intf_hdl *pintfhdl, u32 addr, u32 v, s32 *err)
if (claim_needed)
sdio_release_host(func);

- if (err && *err)
- {
+ if (err && *err) {
int i;

DBG_871X(KERN_ERR "%s: (%d) addr = 0x%05x val = 0x%08x\n", __func__, *err, addr, v);

*err = 0;
- for (i = 0; i < SD_IO_TRY_CNT; i++)
- {
+ for (i = 0; i < SD_IO_TRY_CNT; i++) {
if (claim_needed) sdio_claim_host(func);
sdio_writel(func, v, addr, err);
if (claim_needed) sdio_release_host(func);
@@ -420,13 +416,11 @@ s32 _sd_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata)

func = psdio->func;

- if (unlikely((cnt == 1) || (cnt == 2)))
- {
+ if (unlikely((cnt == 1) || (cnt == 2))) {
int i;
u8 *pbuf = pdata;

- for (i = 0; i < cnt; i++)
- {
+ for (i = 0; i < cnt; i++) {
*(pbuf+i) = sdio_readb(func, addr+i, &err);

if (err) {
@@ -523,13 +517,11 @@ s32 _sd_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata)
func = psdio->func;
/* size = sdio_align_size(func, cnt); */

- if (unlikely((cnt == 1) || (cnt == 2)))
- {
+ if (unlikely((cnt == 1) || (cnt == 2))) {
int i;
u8 *pbuf = pdata;

- for (i = 0; i < cnt; i++)
- {
+ for (i = 0; i < cnt; i++) {
sdio_writeb(func, *(pbuf+i), addr+i, &err);
if (err) {
DBG_871X(KERN_ERR "%s: FAIL!(%d) addr = 0x%05x val = 0x%02x\n", __func__, err, addr, *(pbuf+i));
--
2.7.4

2019-06-16 08:14:01

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH v2] staging: rtl8723bs: Resolve checkpatch error "that open brace { should be on the previous line" in the rtl8723 driver

On Sat, 2019-06-15 at 14:29 -0700, Shobhit Kukreti wrote:
> Cleaned up the code from the following files to get rid of
> check patch error "that open brace { should be on the previous line"

It's fine you are modifying brace styles, but:

> diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> index aa2499f..4631b68 100644
> --- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> +++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> @@ -46,8 +46,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
> struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
>
> if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
> - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
> - {
> + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
> rtw_cfg80211_ibss_indicate_connect(adapter);
> }
> else

the else should be on the same line as the close brace

> @@ -106,8 +105,9 @@ void rtw_reset_securitypriv(struct adapter *adapter)
> adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
>
> }
> - else /* reset values in securitypriv */
> - {
> + else {
> + /* reset values in securitypriv */
> +

and here. etc. Please change all instances appropriately.


2019-06-16 13:12:49

by Shobhit Kukreti

[permalink] [raw]
Subject: Re: [PATCH v2] staging: rtl8723bs: Resolve checkpatch error "that open brace { should be on the previous line" in the rtl8723 driver

On Sun, Jun 16, 2019 at 01:13:11AM -0700, Joe Perches wrote:
> On Sat, 2019-06-15 at 14:29 -0700, Shobhit Kukreti wrote:
> > Cleaned up the code from the following files to get rid of
> > check patch error "that open brace { should be on the previous line"
>
> It's fine you are modifying brace styles, but:
>
> > diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> > index aa2499f..4631b68 100644
> > --- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> > +++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> > @@ -46,8 +46,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
> > struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
> >
> > if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
> > - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
> > - {
> > + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
> > rtw_cfg80211_ibss_indicate_connect(adapter);
> > }
> > else
>
> the else should be on the same line as the close brace
>
> > @@ -106,8 +105,9 @@ void rtw_reset_securitypriv(struct adapter *adapter)
> > adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
> >
> > }
> > - else /* reset values in securitypriv */
> > - {
> > + else {
> > + /* reset values in securitypriv */
> > +
>
> and here. etc. Please change all instances appropriately.
Thank you for the feedback. I intented to do one kind of change in a
patch. This probably would need a patch set. Will edit appropriately.

Best,
Shobhit Kukreti
>
>

2019-06-16 16:20:47

by Shobhit Kukreti

[permalink] [raw]
Subject: [PATCH v3 0/3] Resolve checkpatch if/else brace style errors

This patchset fixes the following errors reported by checkpatch in the
staging/rtl8723bs driver.

Patch[1/3]: Fix check patch error "that open brace { should be on the previous line"

Patch[2/3]: Fix the error else should follow close brace '}'

Patch[3/3]: Fix Indentation Error

version 3 changes:
- Converted the patch to a patchset
- Resolve checkpatch errors:
else should follow close brace '}'
Fixed Indentation Error to use tabs
- Compiles and builds, untested on real hardware.


version 2 changes:
- Removed Trailing whitespace introduced in the previous patch
- Moved comments to a new line in the else statement

Shobhit Kukreti (3):
staging: rtl8723bs: Resolve checkpatch error "that open brace { should
be on the previous line" in the rtl8723 driver
staging: rtl8723bs: Resolve the checkpatch error: else should follow
close brace '}'
staging: rtl8723bs: Fix Indentation Error: code indent should use tabs
where possible

drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 19 ++---
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 90 ++++++++---------------
drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 6 +-
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 54 ++++++--------
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c | 24 ++----
5 files changed, 71 insertions(+), 122 deletions(-)

--
2.7.4

2019-06-16 16:20:49

by Shobhit Kukreti

[permalink] [raw]
Subject: [PATCH v3 1/3] staging: rtl8723bs: Resolve checkpatch error "that open brace { should be on the previous line" in the rtl8723 driver

Cleaned up the code from the following files to get rid of
check patch error "that open brace { should be on the previous line"

drivers/staging/rtl8723bs/os_dep/mlme_linux.c
drivers/staging/rtl8723bs/os_dep/recv_linux.c
drivers/staging/rtl8723bs/os_dep/rtw_proc.c
drivers/staging/rtl8723bs/os_dep/sdio_intf.c
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c

Signed-off-by: Shobhit Kukreti <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 15 +++--
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 77 ++++++++---------------
drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 6 +-
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 15 ++---
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c | 24 +++----
5 files changed, 49 insertions(+), 88 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
index aa2499f..4631b68 100644
--- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
@@ -46,8 +46,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);

if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
- (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
- {
+ (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
rtw_cfg80211_ibss_indicate_connect(adapter);
}
else
@@ -77,8 +76,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)

spin_lock_bh(&adapter->security_key_mutex);

- if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)/* 802.1x */
- {
+ if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { /* 802.1x */
+
/* Added by Albert 2009/02/18 */
/* We have to backup the PMK information for WiFi PMK Caching test item. */
/* */
@@ -106,8 +105,9 @@ void rtw_reset_securitypriv(struct adapter *adapter)
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;

}
- else /* reset values in securitypriv */
- {
+ else {
+ /* reset values in securitypriv */
+
/* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
/* */
struct security_priv *psec_priv = &adapter->securitypriv;
@@ -150,8 +150,7 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
RT_TRACE(_module_mlme_osdep_c_, _drv_info_, ("+rtw_report_sec_ie, authmode =%d\n", authmode));

buff = NULL;
- if (authmode == _WPA_IE_ID_)
- {
+ if (authmode == _WPA_IE_ID_) {
RT_TRACE(_module_mlme_osdep_c_, _drv_info_, ("rtw_report_sec_ie, authmode =%d\n", authmode));

buff = rtw_zmalloc(IW_CUSTOM_MAX);
diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index 3fe9c22..a2055f6 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -12,8 +12,7 @@

void rtw_os_free_recvframe(union recv_frame *precvframe)
{
- if (precvframe->u.hdr.pkt)
- {
+ if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */

precvframe->u.hdr.pkt = NULL;
@@ -34,10 +33,8 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)

precvframe = (union recv_frame*) precvpriv->precv_frame_buf;

- for (i = 0; i < NR_RECVFRAME; i++)
- {
- if (precvframe->u.hdr.pkt)
- {
+ for (i = 0; i < NR_RECVFRAME; i++) {
+ if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
precvframe->u.hdr.pkt = NULL;
}
@@ -48,8 +45,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
/* free os related resource in struct recv_buf */
void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf)
{
- if (precvbuf->pskb)
- {
+ if (precvbuf->pskb) {
dev_kfree_skb_any(precvbuf->pskb);
}
}
@@ -63,22 +59,18 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
pattrib = &prframe->u.hdr.attrib;

sub_skb = rtw_skb_alloc(nSubframe_Length + 12);
- if (sub_skb)
- {
+ if (sub_skb) {
skb_reserve(sub_skb, 12);
skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
}
- else
- {
+ else {
sub_skb = rtw_skb_clone(prframe->u.hdr.pkt);
- if (sub_skb)
- {
+ if (sub_skb) {
sub_skb->data = pdata + ETH_HLEN;
sub_skb->len = nSubframe_Length;
skb_set_tail_pointer(sub_skb, nSubframe_Length);
}
- else
- {
+ else {
DBG_871X("%s(): rtw_skb_clone() Fail!!!\n", __func__);
return NULL;
}
@@ -113,8 +105,7 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt

/* Indicat the packets to upper layer */
if (pkt) {
- if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
- {
+ if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
_pkt *pskb2 = NULL;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
@@ -122,20 +113,17 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt

/* DBG_871X("bmcast =%d\n", bmcast); */

- if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN))
- {
+ if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)) {
/* DBG_871X("not ap psta =%p, addr =%pM\n", psta, pattrib->dst); */

- if (bmcast)
- {
+ if (bmcast) {
psta = rtw_get_bcmc_stainfo(padapter);
pskb2 = rtw_skb_clone(pkt);
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
}

- if (psta)
- {
+ if (psta) {
struct net_device *pnetdev = (struct net_device*)padapter->pnetdev;

/* DBG_871X("directly forwarding to the rtw_xmit_entry\n"); */
@@ -155,8 +143,9 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt
}
}
}
- else/* to APself */
- {
+ else {
+ /* to APself */
+
/* DBG_871X("to APSelf\n"); */
DBG_COUNTER(padapter->rx_logs.os_indicate_ap_self);
}
@@ -192,32 +181,26 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
struct security_priv *psecuritypriv = &padapter->securitypriv;
unsigned long cur_time = 0;

- if (psecuritypriv->last_mic_err_time == 0)
- {
+ if (psecuritypriv->last_mic_err_time == 0) {
psecuritypriv->last_mic_err_time = jiffies;
}
- else
- {
+ else {
cur_time = jiffies;

- if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ)
- {
+ if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) {
psecuritypriv->btkip_countermeasure = true;
psecuritypriv->last_mic_err_time = 0;
psecuritypriv->btkip_countermeasure_time = cur_time;
}
- else
- {
+ else {
psecuritypriv->last_mic_err_time = jiffies;
}
}

- if (bgroup)
- {
+ if (bgroup) {
key_type |= NL80211_KEYTYPE_GROUP;
}
- else
- {
+ else {
key_type |= NL80211_KEYTYPE_PAIRWISE;
}

@@ -225,12 +208,10 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
NULL, GFP_ATOMIC);

memset(&ev, 0x00, sizeof(ev));
- if (bgroup)
- {
+ if (bgroup) {
ev.flags |= IW_MICFAILURE_GROUP;
}
- else
- {
+ else {
ev.flags |= IW_MICFAILURE_PAIRWISE;
}

@@ -250,8 +231,7 @@ static void rtw_os_ksocket_send(struct adapter *padapter, union recv_frame *prec

DBG_871X("eth rx: got eth_type = 0x%x\n", pattrib->eth_type);

- if (psta && psta->isrc && psta->pid>0)
- {
+ if (psta && psta->isrc && psta->pid>0) {
u16 rx_pid;

rx_pid = *(u16*)(skb->data+ETH_HLEN);
@@ -259,8 +239,7 @@ static void rtw_os_ksocket_send(struct adapter *padapter, union recv_frame *prec
DBG_871X("eth rx(pid = 0x%x): sta("MAC_FMT") pid = 0x%x\n",
rx_pid, MAC_ARG(psta->hwaddr), psta->pid);

- if (rx_pid == psta->pid)
- {
+ if (rx_pid == psta->pid) {
int i;
u16 len = *(u16*)(skb->data+ETH_HLEN+2);
/* u16 ctrl_type = *(u16*)(skb->data+ETH_HLEN+4); */
@@ -293,8 +272,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
pfree_recv_queue = &(precvpriv->free_recv_queue);

skb = precv_frame->u.hdr.pkt;
- if (skb == NULL)
- {
+ if (skb == NULL) {
RT_TRACE(_module_recv_osdep_c_, _drv_err_, ("rtw_recv_indicatepkt():skb == NULL something wrong!!!!\n"));
goto _recv_indicatepkt_drop;
}
@@ -312,8 +290,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("\n skb->head =%p skb->data =%p skb->tail =%p skb->end =%p skb->len =%d\n", skb->head, skb->data, skb_tail_pointer(skb), skb_end_pointer(skb), skb->len));

#ifdef CONFIG_AUTO_AP_MODE
- if (0x8899 == pattrib->eth_type)
- {
+ if (0x8899 == pattrib->eth_type) {
rtw_os_ksocket_send(padapter, precv_frame);

/* goto _recv_indicatepkt_drop; */
diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
index d6862e8..5f950fd 100644
--- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
+++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
@@ -63,8 +63,7 @@ static ssize_t proc_set_log_level(struct file *file, const char __user *buffer,

if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
sscanf(tmp, "%d ", &log_level);
- if (log_level >= _drv_always_ && log_level <= _drv_debug_)
- {
+ if (log_level >= _drv_always_ && log_level <= _drv_debug_) {
GlobalDebugLevel = log_level;
printk("%d\n", GlobalDebugLevel);
}
@@ -224,8 +223,7 @@ static ssize_t proc_set_linked_info_dump(struct file *file, const char __user *b
return -EFAULT;

if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
- if (padapter)
- {
+ if (padapter) {
/* padapter->bLinkInfoDump = mode; */
/* DBG_871X("linked_info_dump =%s\n", (padapter->bLinkInfoDump)?"enable":"disable"); */
linked_info_dump(padapter, mode);
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 101a22f..c60f13c 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -85,13 +85,11 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)
sdio_claim_host(func);

err = sdio_claim_irq(func, &sd_sync_int_hdl);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_alloc_irq_error_cnt++;
printk(KERN_CRIT "%s: sdio_claim_irq FAIL(%d)!\n", __func__, err);
}
- else
- {
+ else {
dvobj->drv_dbg.dbg_sdio_alloc_irq_cnt++;
dvobj->irq_alloc = 1;
}
@@ -114,8 +112,7 @@ static void sdio_free_irq(struct dvobj_priv *dvobj)
if (func) {
sdio_claim_host(func);
err = sdio_release_irq(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_871X_LEVEL(_drv_err_,"%s: sdio_release_irq FAIL(%d)!\n", __func__, err);
}
@@ -225,16 +222,14 @@ static void sdio_deinit(struct dvobj_priv *dvobj)
if (func) {
sdio_claim_host(func);
err = sdio_disable_func(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_deinit_error_cnt++;
DBG_8192C(KERN_ERR "%s: sdio_disable_func(%d)\n", __func__, err);
}

if (dvobj->irq_alloc) {
err = sdio_release_irq(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_8192C(KERN_ERR "%s: sdio_release_irq(%d)\n", __func__, err);
}
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
index 1787534..50b8934 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
@@ -257,15 +257,13 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
if (claim_needed)
sdio_release_host(func);

- if (err && *err)
- {
+ if (err && *err) {
int i;

DBG_871X(KERN_ERR "%s: (%d) addr = 0x%05x, val = 0x%x\n", __func__, *err, addr, v);

*err = 0;
- for (i = 0; i < SD_IO_TRY_CNT; i++)
- {
+ for (i = 0; i < SD_IO_TRY_CNT; i++) {
if (claim_needed) sdio_claim_host(func);
v = sdio_readl(func, addr, err);
if (claim_needed) sdio_release_host(func);
@@ -350,15 +348,13 @@ void sd_write32(struct intf_hdl *pintfhdl, u32 addr, u32 v, s32 *err)
if (claim_needed)
sdio_release_host(func);

- if (err && *err)
- {
+ if (err && *err) {
int i;

DBG_871X(KERN_ERR "%s: (%d) addr = 0x%05x val = 0x%08x\n", __func__, *err, addr, v);

*err = 0;
- for (i = 0; i < SD_IO_TRY_CNT; i++)
- {
+ for (i = 0; i < SD_IO_TRY_CNT; i++) {
if (claim_needed) sdio_claim_host(func);
sdio_writel(func, v, addr, err);
if (claim_needed) sdio_release_host(func);
@@ -420,13 +416,11 @@ s32 _sd_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata)

func = psdio->func;

- if (unlikely((cnt == 1) || (cnt == 2)))
- {
+ if (unlikely((cnt == 1) || (cnt == 2))) {
int i;
u8 *pbuf = pdata;

- for (i = 0; i < cnt; i++)
- {
+ for (i = 0; i < cnt; i++) {
*(pbuf+i) = sdio_readb(func, addr+i, &err);

if (err) {
@@ -523,13 +517,11 @@ s32 _sd_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata)
func = psdio->func;
/* size = sdio_align_size(func, cnt); */

- if (unlikely((cnt == 1) || (cnt == 2)))
- {
+ if (unlikely((cnt == 1) || (cnt == 2))) {
int i;
u8 *pbuf = pdata;

- for (i = 0; i < cnt; i++)
- {
+ for (i = 0; i < cnt; i++) {
sdio_writeb(func, *(pbuf+i), addr+i, &err);
if (err) {
DBG_871X(KERN_ERR "%s: FAIL!(%d) addr = 0x%05x val = 0x%02x\n", __func__, err, addr, *(pbuf+i));
--
2.7.4

2019-06-16 16:20:52

by Shobhit Kukreti

[permalink] [raw]
Subject: [PATCH v3 2/3] staging: rtl8723bs: Resolve the checkpatch error: else should follow close brace '}'

Cleaned up the code to resolve the checkpatch error else should follow
close brace '}' from the following files:

mlme_linux.c
recv_linux.c
sdio_intf.c

Signed-off-by: Shobhit Kukreti <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 6 ++----
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 21 +++++++--------------
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 9 +++------
3 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
index 4631b68..6a5ab35 100644
--- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
@@ -48,8 +48,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
rtw_cfg80211_ibss_indicate_connect(adapter);
- }
- else
+ } else
rtw_cfg80211_indicate_connect(adapter);

rtw_indicate_wx_assoc_event(adapter);
@@ -104,8 +103,7 @@ void rtw_reset_securitypriv(struct adapter *adapter)
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;

- }
- else {
+ } else {
/* reset values in securitypriv */

/* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index a2055f6..aab0195 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -62,15 +62,13 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
if (sub_skb) {
skb_reserve(sub_skb, 12);
skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
- }
- else {
+ } else {
sub_skb = rtw_skb_clone(prframe->u.hdr.pkt);
if (sub_skb) {
sub_skb->data = pdata + ETH_HLEN;
sub_skb->len = nSubframe_Length;
skb_set_tail_pointer(sub_skb, nSubframe_Length);
- }
- else {
+ } else {
DBG_871X("%s(): rtw_skb_clone() Fail!!!\n", __func__);
return NULL;
}
@@ -142,8 +140,7 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt
return;
}
}
- }
- else {
+ } else {
/* to APself */

/* DBG_871X("to APSelf\n"); */
@@ -183,24 +180,21 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)

if (psecuritypriv->last_mic_err_time == 0) {
psecuritypriv->last_mic_err_time = jiffies;
- }
- else {
+ } else {
cur_time = jiffies;

if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) {
psecuritypriv->btkip_countermeasure = true;
psecuritypriv->last_mic_err_time = 0;
psecuritypriv->btkip_countermeasure_time = cur_time;
- }
- else {
+ } else {
psecuritypriv->last_mic_err_time = jiffies;
}
}

if (bgroup) {
key_type |= NL80211_KEYTYPE_GROUP;
- }
- else {
+ } else {
key_type |= NL80211_KEYTYPE_PAIRWISE;
}

@@ -210,8 +204,7 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
memset(&ev, 0x00, sizeof(ev));
if (bgroup) {
ev.flags |= IW_MICFAILURE_GROUP;
- }
- else {
+ } else {
ev.flags |= IW_MICFAILURE_PAIRWISE;
}

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index c60f13c..9c408d9 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -88,8 +88,7 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)
if (err) {
dvobj->drv_dbg.dbg_sdio_alloc_irq_error_cnt++;
printk(KERN_CRIT "%s: sdio_claim_irq FAIL(%d)!\n", __func__, err);
- }
- else {
+ } else {
dvobj->drv_dbg.dbg_sdio_alloc_irq_cnt++;
dvobj->irq_alloc = 1;
}
@@ -115,8 +114,7 @@ static void sdio_free_irq(struct dvobj_priv *dvobj)
if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_871X_LEVEL(_drv_err_,"%s: sdio_release_irq FAIL(%d)!\n", __func__, err);
- }
- else
+ } else
dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
sdio_release_host(func);
}
@@ -232,8 +230,7 @@ static void sdio_deinit(struct dvobj_priv *dvobj)
if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_8192C(KERN_ERR "%s: sdio_release_irq(%d)\n", __func__, err);
- }
- else
+ } else
dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
}

--
2.7.4

2019-06-16 16:22:15

by Shobhit Kukreti

[permalink] [raw]
Subject: [PATCH v3 3/3] staging: rtl8723bs: Fix Indentation Error: code indent should use tabs where possible

Resolve indentation errors which were caused by a mix of space and tabs
for indentation. Previous patch to fix if-else brace styles revealed
the indentation error

Signed-off-by: Shobhit Kukreti <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 6 ++---
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 36 +++++++++++++--------------
2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index aab0195..8695127 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -203,9 +203,9 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)

memset(&ev, 0x00, sizeof(ev));
if (bgroup) {
- ev.flags |= IW_MICFAILURE_GROUP;
+ ev.flags |= IW_MICFAILURE_GROUP;
} else {
- ev.flags |= IW_MICFAILURE_PAIRWISE;
+ ev.flags |= IW_MICFAILURE_PAIRWISE;
}

ev.src_addr.sa_family = ARPHRD_ETHER;
@@ -298,7 +298,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame

RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("\n rtw_recv_indicatepkt :after rtw_os_recv_indicate_pkt!!!!\n"));

- return _SUCCESS;
+ return _SUCCESS;

_recv_indicatepkt_drop:

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 9c408d9..540a7ee 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -100,26 +100,26 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)

static void sdio_free_irq(struct dvobj_priv *dvobj)
{
- struct sdio_data *psdio_data;
- struct sdio_func *func;
- int err;
-
- if (dvobj->irq_alloc) {
- psdio_data = &dvobj->intf_data;
- func = psdio_data->func;
-
- if (func) {
- sdio_claim_host(func);
- err = sdio_release_irq(func);
- if (err) {
+ struct sdio_data *psdio_data;
+ struct sdio_func *func;
+ int err;
+
+ if (dvobj->irq_alloc) {
+ psdio_data = &dvobj->intf_data;
+ func = psdio_data->func;
+
+ if (func) {
+ sdio_claim_host(func);
+ err = sdio_release_irq(func);
+ if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_871X_LEVEL(_drv_err_,"%s: sdio_release_irq FAIL(%d)!\n", __func__, err);
- } else
- dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
- sdio_release_host(func);
- }
- dvobj->irq_alloc = 0;
- }
+ } else
+ dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
+ sdio_release_host(func);
+ }
+ dvobj->irq_alloc = 0;
+ }
}

#ifdef CONFIG_GPIO_WAKEUP
--
2.7.4

2019-06-18 07:01:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] staging: rtl8723bs: Resolve checkpatch error "that open brace { should be on the previous line" in the rtl8723 driver

On Sun, Jun 16, 2019 at 09:19:49AM -0700, Shobhit Kukreti wrote:
> Cleaned up the code from the following files to get rid of
> check patch error "that open brace { should be on the previous line"
>
> drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> drivers/staging/rtl8723bs/os_dep/recv_linux.c
> drivers/staging/rtl8723bs/os_dep/rtw_proc.c
> drivers/staging/rtl8723bs/os_dep/sdio_intf.c
> drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
>
> Signed-off-by: Shobhit Kukreti <[email protected]>
> ---
> drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 15 +++--
> drivers/staging/rtl8723bs/os_dep/recv_linux.c | 77 ++++++++---------------
> drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 6 +-
> drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 15 ++---
> drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c | 24 +++----
> 5 files changed, 49 insertions(+), 88 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> index aa2499f..4631b68 100644
> --- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> +++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
> @@ -46,8 +46,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
> struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
>
> if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
> - (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
> - {
> + (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
> rtw_cfg80211_ibss_indicate_connect(adapter);
> }
> else
> @@ -77,8 +76,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)
>
> spin_lock_bh(&adapter->security_key_mutex);
>
> - if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)/* 802.1x */
> - {
> + if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { /* 802.1x */
> +

Why the blank line?

And don't keep the comment on the right side, that's just a pain to work
with.

thanks,

greg k-h

2019-06-19 00:38:28

by Shobhit Kukreti

[permalink] [raw]
Subject: [PATCH v4 0/3] Resolve if/else brace-style errors

This patchset fixes the following errors reported by checkpatch in the
staging/rtl8723bs driver.

Patch[1/3]: Fix check patch error "that open brace { should be on the
previous line"

Patch[2/3]: Fix the error else should follow close brace '}'

Patch[3/3]: Fix Indentation Error

The patch should be applied in the sequence of 1-3.
Each patch performs one clean up operation.

version 4 changes:
- Moved comments to a new line
- Removed an extra blank line

version 3 changes:
- Converted the patch to a patchset
- Resolve checkpatch errors:
else should follow close brace '}'
Fixed Indentation Error to use tabs
- Compiles and builds, untested on real hardware.

version 2 changes:
- Removed Trailing whitespace introduced in the previous patch
- Moved comments to a new line in the else statement

Shobhit Kukreti (3):
staging: rtl8723bs: Resolve checkpatch error "that open brace { should
be on the previous line" in the rtl8723 driver
staging: rtl8723bs: Resolve the checkpatch error: else should follow
close brace '}'
staging: rtl8723bs: Fix Indentation Error: code indent should use tabs
where possible

drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 18 ++---
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 89 ++++++++---------------
drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 6 +-
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 54 ++++++--------
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c | 24 ++----
5 files changed, 69 insertions(+), 122 deletions(-)

--
2.7.4

2019-06-19 00:38:38

by Shobhit Kukreti

[permalink] [raw]
Subject: [PATCH v4 1/3] staging: rtl8723bs: Resolve checkpatch error "that open brace { should be on the previous line" in the rtl8723 driver

Cleaned up the code from the following files to get rid of
check patch error "that open brace { should be on the previous line"

drivers/staging/rtl8723bs/os_dep/mlme_linux.c
drivers/staging/rtl8723bs/os_dep/recv_linux.c
drivers/staging/rtl8723bs/os_dep/rtw_proc.c
drivers/staging/rtl8723bs/os_dep/sdio_intf.c
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c

Signed-off-by: Shobhit Kukreti <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 14 ++---
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 76 ++++++++---------------
drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 6 +-
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 15 ++---
drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c | 24 +++----
5 files changed, 47 insertions(+), 88 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
index aa2499f..4bccfd6 100644
--- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
@@ -46,8 +46,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);

if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
- (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
- {
+ (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
rtw_cfg80211_ibss_indicate_connect(adapter);
}
else
@@ -77,8 +76,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)

spin_lock_bh(&adapter->security_key_mutex);

- if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)/* 802.1x */
- {
+ if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
+ /* 802.1x */
/* Added by Albert 2009/02/18 */
/* We have to backup the PMK information for WiFi PMK Caching test item. */
/* */
@@ -106,8 +105,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;

}
- else /* reset values in securitypriv */
- {
+ else {
+ /* reset values in securitypriv */
/* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
/* */
struct security_priv *psec_priv = &adapter->securitypriv;
@@ -150,8 +149,7 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
RT_TRACE(_module_mlme_osdep_c_, _drv_info_, ("+rtw_report_sec_ie, authmode =%d\n", authmode));

buff = NULL;
- if (authmode == _WPA_IE_ID_)
- {
+ if (authmode == _WPA_IE_ID_) {
RT_TRACE(_module_mlme_osdep_c_, _drv_info_, ("rtw_report_sec_ie, authmode =%d\n", authmode));

buff = rtw_zmalloc(IW_CUSTOM_MAX);
diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index 3fe9c22..17c5199 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -12,8 +12,7 @@

void rtw_os_free_recvframe(union recv_frame *precvframe)
{
- if (precvframe->u.hdr.pkt)
- {
+ if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */

precvframe->u.hdr.pkt = NULL;
@@ -34,10 +33,8 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)

precvframe = (union recv_frame*) precvpriv->precv_frame_buf;

- for (i = 0; i < NR_RECVFRAME; i++)
- {
- if (precvframe->u.hdr.pkt)
- {
+ for (i = 0; i < NR_RECVFRAME; i++) {
+ if (precvframe->u.hdr.pkt) {
dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
precvframe->u.hdr.pkt = NULL;
}
@@ -48,8 +45,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
/* free os related resource in struct recv_buf */
void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf)
{
- if (precvbuf->pskb)
- {
+ if (precvbuf->pskb) {
dev_kfree_skb_any(precvbuf->pskb);
}
}
@@ -63,22 +59,18 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
pattrib = &prframe->u.hdr.attrib;

sub_skb = rtw_skb_alloc(nSubframe_Length + 12);
- if (sub_skb)
- {
+ if (sub_skb) {
skb_reserve(sub_skb, 12);
skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
}
- else
- {
+ else {
sub_skb = rtw_skb_clone(prframe->u.hdr.pkt);
- if (sub_skb)
- {
+ if (sub_skb) {
sub_skb->data = pdata + ETH_HLEN;
sub_skb->len = nSubframe_Length;
skb_set_tail_pointer(sub_skb, nSubframe_Length);
}
- else
- {
+ else {
DBG_871X("%s(): rtw_skb_clone() Fail!!!\n", __func__);
return NULL;
}
@@ -113,8 +105,7 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt

/* Indicat the packets to upper layer */
if (pkt) {
- if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
- {
+ if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
_pkt *pskb2 = NULL;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
@@ -122,20 +113,17 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt

/* DBG_871X("bmcast =%d\n", bmcast); */

- if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN))
- {
+ if (memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)) {
/* DBG_871X("not ap psta =%p, addr =%pM\n", psta, pattrib->dst); */

- if (bmcast)
- {
+ if (bmcast) {
psta = rtw_get_bcmc_stainfo(padapter);
pskb2 = rtw_skb_clone(pkt);
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
}

- if (psta)
- {
+ if (psta) {
struct net_device *pnetdev = (struct net_device*)padapter->pnetdev;

/* DBG_871X("directly forwarding to the rtw_xmit_entry\n"); */
@@ -155,8 +143,8 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt
}
}
}
- else/* to APself */
- {
+ else {
+ /* to APself */
/* DBG_871X("to APSelf\n"); */
DBG_COUNTER(padapter->rx_logs.os_indicate_ap_self);
}
@@ -192,32 +180,26 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
struct security_priv *psecuritypriv = &padapter->securitypriv;
unsigned long cur_time = 0;

- if (psecuritypriv->last_mic_err_time == 0)
- {
+ if (psecuritypriv->last_mic_err_time == 0) {
psecuritypriv->last_mic_err_time = jiffies;
}
- else
- {
+ else {
cur_time = jiffies;

- if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ)
- {
+ if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) {
psecuritypriv->btkip_countermeasure = true;
psecuritypriv->last_mic_err_time = 0;
psecuritypriv->btkip_countermeasure_time = cur_time;
}
- else
- {
+ else {
psecuritypriv->last_mic_err_time = jiffies;
}
}

- if (bgroup)
- {
+ if (bgroup) {
key_type |= NL80211_KEYTYPE_GROUP;
}
- else
- {
+ else {
key_type |= NL80211_KEYTYPE_PAIRWISE;
}

@@ -225,12 +207,10 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
NULL, GFP_ATOMIC);

memset(&ev, 0x00, sizeof(ev));
- if (bgroup)
- {
+ if (bgroup) {
ev.flags |= IW_MICFAILURE_GROUP;
}
- else
- {
+ else {
ev.flags |= IW_MICFAILURE_PAIRWISE;
}

@@ -250,8 +230,7 @@ static void rtw_os_ksocket_send(struct adapter *padapter, union recv_frame *prec

DBG_871X("eth rx: got eth_type = 0x%x\n", pattrib->eth_type);

- if (psta && psta->isrc && psta->pid>0)
- {
+ if (psta && psta->isrc && psta->pid>0) {
u16 rx_pid;

rx_pid = *(u16*)(skb->data+ETH_HLEN);
@@ -259,8 +238,7 @@ static void rtw_os_ksocket_send(struct adapter *padapter, union recv_frame *prec
DBG_871X("eth rx(pid = 0x%x): sta("MAC_FMT") pid = 0x%x\n",
rx_pid, MAC_ARG(psta->hwaddr), psta->pid);

- if (rx_pid == psta->pid)
- {
+ if (rx_pid == psta->pid) {
int i;
u16 len = *(u16*)(skb->data+ETH_HLEN+2);
/* u16 ctrl_type = *(u16*)(skb->data+ETH_HLEN+4); */
@@ -293,8 +271,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
pfree_recv_queue = &(precvpriv->free_recv_queue);

skb = precv_frame->u.hdr.pkt;
- if (skb == NULL)
- {
+ if (skb == NULL) {
RT_TRACE(_module_recv_osdep_c_, _drv_err_, ("rtw_recv_indicatepkt():skb == NULL something wrong!!!!\n"));
goto _recv_indicatepkt_drop;
}
@@ -312,8 +289,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("\n skb->head =%p skb->data =%p skb->tail =%p skb->end =%p skb->len =%d\n", skb->head, skb->data, skb_tail_pointer(skb), skb_end_pointer(skb), skb->len));

#ifdef CONFIG_AUTO_AP_MODE
- if (0x8899 == pattrib->eth_type)
- {
+ if (0x8899 == pattrib->eth_type) {
rtw_os_ksocket_send(padapter, precv_frame);

/* goto _recv_indicatepkt_drop; */
diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
index d6862e8..5f950fd 100644
--- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
+++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
@@ -63,8 +63,7 @@ static ssize_t proc_set_log_level(struct file *file, const char __user *buffer,

if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
sscanf(tmp, "%d ", &log_level);
- if (log_level >= _drv_always_ && log_level <= _drv_debug_)
- {
+ if (log_level >= _drv_always_ && log_level <= _drv_debug_) {
GlobalDebugLevel = log_level;
printk("%d\n", GlobalDebugLevel);
}
@@ -224,8 +223,7 @@ static ssize_t proc_set_linked_info_dump(struct file *file, const char __user *b
return -EFAULT;

if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
- if (padapter)
- {
+ if (padapter) {
/* padapter->bLinkInfoDump = mode; */
/* DBG_871X("linked_info_dump =%s\n", (padapter->bLinkInfoDump)?"enable":"disable"); */
linked_info_dump(padapter, mode);
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 101a22f..c60f13c 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -85,13 +85,11 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)
sdio_claim_host(func);

err = sdio_claim_irq(func, &sd_sync_int_hdl);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_alloc_irq_error_cnt++;
printk(KERN_CRIT "%s: sdio_claim_irq FAIL(%d)!\n", __func__, err);
}
- else
- {
+ else {
dvobj->drv_dbg.dbg_sdio_alloc_irq_cnt++;
dvobj->irq_alloc = 1;
}
@@ -114,8 +112,7 @@ static void sdio_free_irq(struct dvobj_priv *dvobj)
if (func) {
sdio_claim_host(func);
err = sdio_release_irq(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_871X_LEVEL(_drv_err_,"%s: sdio_release_irq FAIL(%d)!\n", __func__, err);
}
@@ -225,16 +222,14 @@ static void sdio_deinit(struct dvobj_priv *dvobj)
if (func) {
sdio_claim_host(func);
err = sdio_disable_func(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_deinit_error_cnt++;
DBG_8192C(KERN_ERR "%s: sdio_disable_func(%d)\n", __func__, err);
}

if (dvobj->irq_alloc) {
err = sdio_release_irq(func);
- if (err)
- {
+ if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_8192C(KERN_ERR "%s: sdio_release_irq(%d)\n", __func__, err);
}
diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
index 1787534..50b8934 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
@@ -257,15 +257,13 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
if (claim_needed)
sdio_release_host(func);

- if (err && *err)
- {
+ if (err && *err) {
int i;

DBG_871X(KERN_ERR "%s: (%d) addr = 0x%05x, val = 0x%x\n", __func__, *err, addr, v);

*err = 0;
- for (i = 0; i < SD_IO_TRY_CNT; i++)
- {
+ for (i = 0; i < SD_IO_TRY_CNT; i++) {
if (claim_needed) sdio_claim_host(func);
v = sdio_readl(func, addr, err);
if (claim_needed) sdio_release_host(func);
@@ -350,15 +348,13 @@ void sd_write32(struct intf_hdl *pintfhdl, u32 addr, u32 v, s32 *err)
if (claim_needed)
sdio_release_host(func);

- if (err && *err)
- {
+ if (err && *err) {
int i;

DBG_871X(KERN_ERR "%s: (%d) addr = 0x%05x val = 0x%08x\n", __func__, *err, addr, v);

*err = 0;
- for (i = 0; i < SD_IO_TRY_CNT; i++)
- {
+ for (i = 0; i < SD_IO_TRY_CNT; i++) {
if (claim_needed) sdio_claim_host(func);
sdio_writel(func, v, addr, err);
if (claim_needed) sdio_release_host(func);
@@ -420,13 +416,11 @@ s32 _sd_read(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata)

func = psdio->func;

- if (unlikely((cnt == 1) || (cnt == 2)))
- {
+ if (unlikely((cnt == 1) || (cnt == 2))) {
int i;
u8 *pbuf = pdata;

- for (i = 0; i < cnt; i++)
- {
+ for (i = 0; i < cnt; i++) {
*(pbuf+i) = sdio_readb(func, addr+i, &err);

if (err) {
@@ -523,13 +517,11 @@ s32 _sd_write(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, void *pdata)
func = psdio->func;
/* size = sdio_align_size(func, cnt); */

- if (unlikely((cnt == 1) || (cnt == 2)))
- {
+ if (unlikely((cnt == 1) || (cnt == 2))) {
int i;
u8 *pbuf = pdata;

- for (i = 0; i < cnt; i++)
- {
+ for (i = 0; i < cnt; i++) {
sdio_writeb(func, *(pbuf+i), addr+i, &err);
if (err) {
DBG_871X(KERN_ERR "%s: FAIL!(%d) addr = 0x%05x val = 0x%02x\n", __func__, err, addr, *(pbuf+i));
--
2.7.4

2019-06-19 00:39:26

by Shobhit Kukreti

[permalink] [raw]
Subject: [PATCH v4 3/3] staging: rtl8723bs: Fix Indentation Error: code indent should use tabs where possible

Resolve indentation errors which were caused by a mix of space and tabs
for indentation. Previous patch to fix if-else brace styles revealed
the indentation error

Signed-off-by: Shobhit Kukreti <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 6 ++---
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 36 +++++++++++++--------------
2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index 746f074..643cacc 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -202,9 +202,9 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)

memset(&ev, 0x00, sizeof(ev));
if (bgroup) {
- ev.flags |= IW_MICFAILURE_GROUP;
+ ev.flags |= IW_MICFAILURE_GROUP;
} else {
- ev.flags |= IW_MICFAILURE_PAIRWISE;
+ ev.flags |= IW_MICFAILURE_PAIRWISE;
}

ev.src_addr.sa_family = ARPHRD_ETHER;
@@ -297,7 +297,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame

RT_TRACE(_module_recv_osdep_c_, _drv_info_, ("\n rtw_recv_indicatepkt :after rtw_os_recv_indicate_pkt!!!!\n"));

- return _SUCCESS;
+ return _SUCCESS;

_recv_indicatepkt_drop:

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index 9c408d9..540a7ee 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -100,26 +100,26 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)

static void sdio_free_irq(struct dvobj_priv *dvobj)
{
- struct sdio_data *psdio_data;
- struct sdio_func *func;
- int err;
-
- if (dvobj->irq_alloc) {
- psdio_data = &dvobj->intf_data;
- func = psdio_data->func;
-
- if (func) {
- sdio_claim_host(func);
- err = sdio_release_irq(func);
- if (err) {
+ struct sdio_data *psdio_data;
+ struct sdio_func *func;
+ int err;
+
+ if (dvobj->irq_alloc) {
+ psdio_data = &dvobj->intf_data;
+ func = psdio_data->func;
+
+ if (func) {
+ sdio_claim_host(func);
+ err = sdio_release_irq(func);
+ if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_871X_LEVEL(_drv_err_,"%s: sdio_release_irq FAIL(%d)!\n", __func__, err);
- } else
- dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
- sdio_release_host(func);
- }
- dvobj->irq_alloc = 0;
- }
+ } else
+ dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
+ sdio_release_host(func);
+ }
+ dvobj->irq_alloc = 0;
+ }
}

#ifdef CONFIG_GPIO_WAKEUP
--
2.7.4

2019-06-19 00:39:56

by Shobhit Kukreti

[permalink] [raw]
Subject: [PATCH v4 2/3] staging: rtl8723bs: Resolve the checkpatch error: else should follow close brace '}'

Cleaned up the code to resolve the checkpatch error else should follow
close brace '}' from the following files:

mlme_linux.c
recv_linux.c
sdio_intf.c

Signed-off-by: Shobhit Kukreti <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 6 ++----
drivers/staging/rtl8723bs/os_dep/recv_linux.c | 21 +++++++--------------
drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 9 +++------
3 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
index 4bccfd6..52a5b31 100644
--- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
@@ -48,8 +48,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
rtw_cfg80211_ibss_indicate_connect(adapter);
- }
- else
+ } else
rtw_cfg80211_indicate_connect(adapter);

rtw_indicate_wx_assoc_event(adapter);
@@ -104,8 +103,7 @@ void rtw_reset_securitypriv(struct adapter *adapter)
adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;

- }
- else {
+ } else {
/* reset values in securitypriv */
/* if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE) */
/* */
diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index 17c5199..746f074 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -62,15 +62,13 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
if (sub_skb) {
skb_reserve(sub_skb, 12);
skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
- }
- else {
+ } else {
sub_skb = rtw_skb_clone(prframe->u.hdr.pkt);
if (sub_skb) {
sub_skb->data = pdata + ETH_HLEN;
sub_skb->len = nSubframe_Length;
skb_set_tail_pointer(sub_skb, nSubframe_Length);
- }
- else {
+ } else {
DBG_871X("%s(): rtw_skb_clone() Fail!!!\n", __func__);
return NULL;
}
@@ -142,8 +140,7 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt
return;
}
}
- }
- else {
+ } else {
/* to APself */
/* DBG_871X("to APSelf\n"); */
DBG_COUNTER(padapter->rx_logs.os_indicate_ap_self);
@@ -182,24 +179,21 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)

if (psecuritypriv->last_mic_err_time == 0) {
psecuritypriv->last_mic_err_time = jiffies;
- }
- else {
+ } else {
cur_time = jiffies;

if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) {
psecuritypriv->btkip_countermeasure = true;
psecuritypriv->last_mic_err_time = 0;
psecuritypriv->btkip_countermeasure_time = cur_time;
- }
- else {
+ } else {
psecuritypriv->last_mic_err_time = jiffies;
}
}

if (bgroup) {
key_type |= NL80211_KEYTYPE_GROUP;
- }
- else {
+ } else {
key_type |= NL80211_KEYTYPE_PAIRWISE;
}

@@ -209,8 +203,7 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
memset(&ev, 0x00, sizeof(ev));
if (bgroup) {
ev.flags |= IW_MICFAILURE_GROUP;
- }
- else {
+ } else {
ev.flags |= IW_MICFAILURE_PAIRWISE;
}

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
index c60f13c..9c408d9 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c
@@ -88,8 +88,7 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)
if (err) {
dvobj->drv_dbg.dbg_sdio_alloc_irq_error_cnt++;
printk(KERN_CRIT "%s: sdio_claim_irq FAIL(%d)!\n", __func__, err);
- }
- else {
+ } else {
dvobj->drv_dbg.dbg_sdio_alloc_irq_cnt++;
dvobj->irq_alloc = 1;
}
@@ -115,8 +114,7 @@ static void sdio_free_irq(struct dvobj_priv *dvobj)
if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_871X_LEVEL(_drv_err_,"%s: sdio_release_irq FAIL(%d)!\n", __func__, err);
- }
- else
+ } else
dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
sdio_release_host(func);
}
@@ -232,8 +230,7 @@ static void sdio_deinit(struct dvobj_priv *dvobj)
if (err) {
dvobj->drv_dbg.dbg_sdio_free_irq_error_cnt++;
DBG_8192C(KERN_ERR "%s: sdio_release_irq(%d)\n", __func__, err);
- }
- else
+ } else
dvobj->drv_dbg.dbg_sdio_free_irq_cnt++;
}

--
2.7.4