All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/4] staging: rtl8723bs: Add necessary braces
@ 2019-11-13  1:34 Javier F. Arias
  2019-11-13  1:36 ` [PATCH v2 2/4] staging: rtl8723bs: Fix unbalanced braces Javier F. Arias
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Javier F. Arias @ 2019-11-13  1:34 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel

This patch adds braces when they should be used on all arms of
the statement.
Issue found by Checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
---
Changes in V2:
	- Add braces and balance statements in the same patch instead
	  of performing a new change in a subsequent patch.
	- Fix a typo in the commit description.

 drivers/staging/rtl8723bs/core/rtw_xmit.c | 34 +++++++++++++----------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index fdb585ff5925..44fc604ea5b7 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -370,9 +370,9 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
 	/* 		Other fragments are protected by previous fragment. */
 	/* 		So we only need to check the length of first fragment. */
 	if (pmlmeext->cur_wireless_mode < WIRELESS_11_24N  || padapter->registrypriv.wifi_spec) {
-		if (sz > padapter->registrypriv.rts_thresh)
+		if (sz > padapter->registrypriv.rts_thresh) {
 			pattrib->vcs_mode = RTS_CTS;
-		else {
+		} else {
 			if (pattrib->rtsen)
 				pattrib->vcs_mode = RTS_CTS;
 			else if (pattrib->cts2self)
@@ -679,8 +679,9 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib
 		memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
 		memcpy(pattrib->ta, get_bssid(pmlmepriv), ETH_ALEN);
 		DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_ap);
-	} else
+	} else {
 		DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_unknown);
+	}
 
 	pattrib->pktlen = pktfile.pkt_len;
 
@@ -724,9 +725,9 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib
 		rtw_set_scan_deny(padapter, 3000);
 
 	/*  If EAPOL , ARP , OR DHCP packet, driver must be in active mode. */
-	if (pattrib->icmp_pkt == 1)
+	if (pattrib->icmp_pkt == 1) {
 		rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1);
-	else if (pattrib->dhcp_pkt == 1) {
+	} else if (pattrib->dhcp_pkt == 1) {
 		DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_active);
 		rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SPECIAL_PACKET, 1);
 	}
@@ -926,8 +927,9 @@ static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmi
 		default:
 				break;
 		}
-	} else
+	} else {
 		RT_TRACE(_module_rtl871x_xmit_c_, _drv_notice_, ("### xmitframe_hwencrypt\n"));
+	}
 
 	return _SUCCESS;
 }
@@ -1204,8 +1206,9 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit_fram
 			ClearMFrag(mem_start);
 
 			break;
-		} else
+		} else {
 			RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("%s: There're still something in packet!\n", __func__));
+		}
 
 		addr = (SIZE_PTR)(pframe);
 
@@ -1446,17 +1449,18 @@ void rtw_update_protection(struct adapter *padapter, u8 *ie, uint ie_len)
 	case AUTO_VCS:
 	default:
 		perp = rtw_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len);
-		if (!perp)
+		if (!perp) {
 			pxmitpriv->vcs = NONE_VCS;
-		else {
+		} else {
 			protection = (*(perp + 2)) & BIT(1);
 			if (protection) {
 				if (pregistrypriv->vcs_type == RTS_CTS)
 					pxmitpriv->vcs = RTS_CTS;
 				else
 					pxmitpriv->vcs = CTS_TO_SELF;
-			} else
+			} else {
 				pxmitpriv->vcs = NONE_VCS;
+			}
 		}
 
 		break;
@@ -1509,8 +1513,9 @@ static struct xmit_buf *__rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv,
 			DBG_871X("%s pxmitbuf->sctx is not NULL\n", __func__);
 			rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
 		}
-	} else
+	} else {
 		DBG_871X("%s fail, no xmitbuf available !!!\n", __func__);
+	}
 
 	return pxmitbuf;
 }
@@ -2177,11 +2182,12 @@ inline bool xmitframe_hiq_filter(struct xmit_frame *xmitframe)
 				, attrib->ether_type, attrib->dhcp_pkt?" DHCP":"");
 			allow = true;
 		}
-	} else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_ALL)
+	} else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_ALL) {
 		allow = true;
-	else if (registry->hiq_filter == RTW_HIQ_FILTER_DENY_ALL) {
-	} else
+	} else if (registry->hiq_filter == RTW_HIQ_FILTER_DENY_ALL) {
+	} else {
 		rtw_warn_on(1);
+	}
 
 	return allow;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/4] staging: rtl8723bs: Fix unbalanced braces
  2019-11-13  1:34 [PATCH v2 1/4] staging: rtl8723bs: Add necessary braces Javier F. Arias
@ 2019-11-13  1:36 ` Javier F. Arias
  2019-11-13 10:43   ` [Outreachy kernel] " Greg KH
  2019-11-13  1:36 ` [PATCH v2 3/4] staging: rtl8723bs: Remove unnecessary conditional block Javier F. Arias
  2019-11-13  1:38 ` [PATCH v2 4/4] staging: rtl8723bs: Rename variable Javier F. Arias
  2 siblings, 1 reply; 7+ messages in thread
From: Javier F. Arias @ 2019-11-13  1:36 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, outreachy-kernel

This patch fixes unbalanced braces around else statements. It also
removes an empty else block.
Issue found by Checkpatch.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
---
Changes in V2:
	- Reduce the scope of the change given that the previous
	  patch had to perform some of these changes.

 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 44fc604ea5b7..5856c6e34922 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -1844,8 +1844,6 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
 		queue = &pxmitpriv->free_xmit_queue;
 	else if (pxmitframe->ext_tag == 1)
 		queue = &pxmitpriv->free_xframe_ext_queue;
-	else {
-	}
 
 	spin_lock_bh(&queue->lock);
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/4] staging: rtl8723bs: Remove unnecessary conditional block
  2019-11-13  1:34 [PATCH v2 1/4] staging: rtl8723bs: Add necessary braces Javier F. Arias
  2019-11-13  1:36 ` [PATCH v2 2/4] staging: rtl8723bs: Fix unbalanced braces Javier F. Arias
@ 2019-11-13  1:36 ` Javier F. Arias
  2019-11-13 10:44   ` Greg KH
  2019-11-13  1:38 ` [PATCH v2 4/4] staging: rtl8723bs: Rename variable Javier F. Arias
  2 siblings, 1 reply; 7+ messages in thread
From: Javier F. Arias @ 2019-11-13  1:36 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel

This patch removes a conditional block that had no effect.
It also reformat the affected lines to set the right indentation
after the removal.
Issue found by Coccinelle.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
---
Changes in V2:
	- No changes.

 drivers/staging/rtl8723bs/hal/sdio_halinit.c | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index 0f5dd4629e6f..b4b535c66bae 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -551,18 +551,13 @@ static void HalRxAggr8723BSdio(struct adapter *padapter)
 
 	pregistrypriv = &padapter->registrypriv;
 
-	if (pregistrypriv->wifi_spec) {
-		/*  2010.04.27 hpfan */
-		/*  Adjust RxAggrTimeout to close to zero disable RxAggr, suggested by designer */
-		/*  Timeout value is calculated by 34 / (2^n) */
-		valueDMATimeout = 0x06;
-		valueDMAPageCount = 0x06;
-	} else {
-		/*  20130530, Isaac@SD1 suggest 3 kinds of parameter */
-		/*  TX/RX Balance */
-		valueDMATimeout = 0x06;
-		valueDMAPageCount = 0x06;
-	}
+	/*  2010.04.27 hpfan */
+	/*  Adjust RxAggrTimeout to close to zero disable RxAggr, suggested by designer */
+	/*  Timeout value is calculated by 34 / (2^n) */
+	valueDMATimeout = 0x06;
+	valueDMAPageCount = 0x06;
+	/*  20130530, Isaac@SD1 suggest 3 kinds of parameter */
+	/*  TX/RX Balance */
 
 	rtw_write8(padapter, REG_RXDMA_AGG_PG_TH + 1, valueDMATimeout);
 	rtw_write8(padapter, REG_RXDMA_AGG_PG_TH, valueDMAPageCount);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 4/4] staging: rtl8723bs: Rename variable
  2019-11-13  1:34 [PATCH v2 1/4] staging: rtl8723bs: Add necessary braces Javier F. Arias
  2019-11-13  1:36 ` [PATCH v2 2/4] staging: rtl8723bs: Fix unbalanced braces Javier F. Arias
  2019-11-13  1:36 ` [PATCH v2 3/4] staging: rtl8723bs: Remove unnecessary conditional block Javier F. Arias
@ 2019-11-13  1:38 ` Javier F. Arias
  2019-11-13 10:45   ` Greg KH
  2 siblings, 1 reply; 7+ messages in thread
From: Javier F. Arias @ 2019-11-13  1:38 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel

This patch renames a variable name previously defined in uppercase.

Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
---
Changes in V2:
	- No changes.

 drivers/staging/rtl8723bs/core/rtw_xmit.c | 24 +++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 5856c6e34922..72d3bfe1aa42 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -1242,7 +1242,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit
 	struct sta_info 	*psta = NULL;
 	struct pkt_attrib	*pattrib = &pxmitframe->attrib;
 	s32 bmcst = IS_MCAST(pattrib->ra);
-	u8 *BIP_AAD = NULL;
+	u8 *bip_aad = NULL;
 	u8 *MGMT_body = NULL;
 
 	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@@ -1254,10 +1254,10 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit
 	pwlanhdr = (struct ieee80211_hdr *)pframe;
 
 	ori_len = BIP_AAD_SIZE+pattrib->pktlen;
-	tmp_buf = BIP_AAD = rtw_zmalloc(ori_len);
+	tmp_buf = bip_aad = rtw_zmalloc(ori_len);
 	subtype = GetFrameSubType(pframe); /* bit(7)~bit(2) */
 
-	if (!BIP_AAD)
+	if (!bip_aad)
 		return _FAIL;
 
 	spin_lock_bh(&padapter->security_key_mutex);
@@ -1300,17 +1300,17 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit
 		frame_body_len = pattrib->pktlen - sizeof(struct ieee80211_hdr_3addr);
 
 		/* conscruct AAD, copy frame control field */
-		memcpy(BIP_AAD, &pwlanhdr->frame_control, 2);
-		ClearRetry(BIP_AAD);
-		ClearPwrMgt(BIP_AAD);
-		ClearMData(BIP_AAD);
+		memcpy(bip_aad, &pwlanhdr->frame_control, 2);
+		ClearRetry(bip_aad);
+		ClearPwrMgt(bip_aad);
+		ClearMData(bip_aad);
 		/* conscruct AAD, copy address 1 to address 3 */
-		memcpy(BIP_AAD+2, pwlanhdr->addr1, 18);
+		memcpy(bip_aad+2, pwlanhdr->addr1, 18);
 		/* copy management fram body */
-		memcpy(BIP_AAD+BIP_AAD_SIZE, MGMT_body, frame_body_len);
+		memcpy(bip_aad+BIP_AAD_SIZE, MGMT_body, frame_body_len);
 		/* calculate mic */
 		if (omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey
-			, BIP_AAD, BIP_AAD_SIZE+frame_body_len, mic))
+			, bip_aad, BIP_AAD_SIZE+frame_body_len, mic))
 			goto xmitframe_coalesce_fail;
 
 		/* copy right BIP mic value, total is 128bits, we use the 0~63 bits */
@@ -1390,12 +1390,12 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit
 
 xmitframe_coalesce_success:
 	spin_unlock_bh(&padapter->security_key_mutex);
-	kfree(BIP_AAD);
+	kfree(bip_aad);
 	return _SUCCESS;
 
 xmitframe_coalesce_fail:
 	spin_unlock_bh(&padapter->security_key_mutex);
-	kfree(BIP_AAD);
+	kfree(bip_aad);
 	return _FAIL;
 }
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 2/4] staging: rtl8723bs: Fix unbalanced braces
  2019-11-13  1:36 ` [PATCH v2 2/4] staging: rtl8723bs: Fix unbalanced braces Javier F. Arias
@ 2019-11-13 10:43   ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2019-11-13 10:43 UTC (permalink / raw)
  To: linux-kernel, outreachy-kernel

On Tue, Nov 12, 2019 at 08:36:12PM -0500, Javier F. Arias wrote:
> This patch fixes unbalanced braces around else statements. It also
> removes an empty else block.

No, it only did one thing here, not 2 :(



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 3/4] staging: rtl8723bs: Remove unnecessary conditional block
  2019-11-13  1:36 ` [PATCH v2 3/4] staging: rtl8723bs: Remove unnecessary conditional block Javier F. Arias
@ 2019-11-13 10:44   ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2019-11-13 10:44 UTC (permalink / raw)
  To: Javier F. Arias; +Cc: linux-kernel

On Tue, Nov 12, 2019 at 08:36:53PM -0500, Javier F. Arias wrote:
> This patch removes a conditional block that had no effect.
> It also reformat the affected lines to set the right indentation
> after the removal.
> Issue found by Coccinelle.
> 
> Signed-off-by: Javier F. Arias <jarias.linux@gmail.com>
> ---
> Changes in V2:
> 	- No changes.
> 
>  drivers/staging/rtl8723bs/hal/sdio_halinit.c | 19 +++++++------------
>  1 file changed, 7 insertions(+), 12 deletions(-)

Please use scripts/get_maintainer.pl on your patches to send them to the
proper mailing lists and developers.  Right now you are only cc: me and
lkml and sometimes the outreachy list, which is odd.

Please fix this up and redo the series.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 4/4] staging: rtl8723bs: Rename variable
  2019-11-13  1:38 ` [PATCH v2 4/4] staging: rtl8723bs: Rename variable Javier F. Arias
@ 2019-11-13 10:45   ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2019-11-13 10:45 UTC (permalink / raw)
  To: Javier F. Arias; +Cc: linux-kernel

On Tue, Nov 12, 2019 at 08:38:47PM -0500, Javier F. Arias wrote:
> This patch renames a variable name previously defined in uppercase.

That says what you did, but not _why_ you want to do it.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-11-13 10:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13  1:34 [PATCH v2 1/4] staging: rtl8723bs: Add necessary braces Javier F. Arias
2019-11-13  1:36 ` [PATCH v2 2/4] staging: rtl8723bs: Fix unbalanced braces Javier F. Arias
2019-11-13 10:43   ` [Outreachy kernel] " Greg KH
2019-11-13  1:36 ` [PATCH v2 3/4] staging: rtl8723bs: Remove unnecessary conditional block Javier F. Arias
2019-11-13 10:44   ` Greg KH
2019-11-13  1:38 ` [PATCH v2 4/4] staging: rtl8723bs: Rename variable Javier F. Arias
2019-11-13 10:45   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.