* [PATCH] staging: rtl8723bs: remove braces in single statement blocks
@ 2022-09-13 13:06 Kang Minchul
2022-09-13 14:34 ` Hans de Goede
0 siblings, 1 reply; 5+ messages in thread
From: Kang Minchul @ 2022-09-13 13:06 UTC (permalink / raw)
To: gregkh; +Cc: hdegoede, linux-staging, Kang Minchul
This commit cleans up checkpatch warning as follows:
WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: Kang Minchul <tegongkang@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index d8d394b67eeb..f20eba7fa471 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1374,9 +1374,8 @@ static signed int validate_80211w_mgmt(struct adapter *adapter, union recv_frame
/* actual management data frame body */
data_len = pattrib->pkt_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len;
mgmt_DATA = rtw_zmalloc(data_len);
- if (!mgmt_DATA) {
+ if (!mgmt_DATA)
goto validate_80211w_fail;
- }
precv_frame = decryptor(adapter, precv_frame);
/* save actual management data frame body */
memcpy(mgmt_DATA, ptr+pattrib->hdrlen+pattrib->iv_len, data_len);
@@ -1385,9 +1384,8 @@ static signed int validate_80211w_mgmt(struct adapter *adapter, union recv_frame
/* remove the iv and icv length */
pattrib->pkt_len = pattrib->pkt_len - pattrib->iv_len - pattrib->icv_len;
kfree(mgmt_DATA);
- if (!precv_frame) {
+ if (!precv_frame)
goto validate_80211w_fail;
- }
} else if (IS_MCAST(GetAddr1Ptr(ptr)) &&
(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC)) {
signed int BIP_ret = _SUCCESS;
@@ -1651,14 +1649,12 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
u16 wend = (preorder_ctrl->indicate_seq + wsize - 1) & 0xFFF;/* 4096; */
/* Rx Reorder initialize condition. */
- if (preorder_ctrl->indicate_seq == 0xFFFF) {
+ if (preorder_ctrl->indicate_seq == 0xFFFF)
preorder_ctrl->indicate_seq = seq_num;
- }
/* Drop out the packet which SeqNum is smaller than WinStart */
- if (SN_LESS(seq_num, preorder_ctrl->indicate_seq)) {
+ if (SN_LESS(seq_num, preorder_ctrl->indicate_seq))
return false;
- }
/* */
/* Sliding window manipulation. Conditions includes: */
@@ -1862,8 +1858,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1)%4096;
- if (retval != _SUCCESS) {
- }
+ if (retval != _SUCCESS)
return retval;
}
@@ -2084,10 +2079,8 @@ s32 rtw_recv_entry(union recv_frame *precvframe)
precvpriv = &padapter->recvpriv;
ret = recv_func(padapter, precvframe);
- if (ret == _FAIL) {
+ if (ret == _FAIL)
goto _recv_entry_drop;
- }
-
precvpriv->rx_pkts++;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: rtl8723bs: remove braces in single statement blocks
2022-09-13 13:06 [PATCH] staging: rtl8723bs: remove braces in single statement blocks Kang Minchul
@ 2022-09-13 14:34 ` Hans de Goede
2022-09-13 16:25 ` [PATCH v2] " Kang Minchul
0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2022-09-13 14:34 UTC (permalink / raw)
To: Kang Minchul, gregkh; +Cc: linux-staging
Hi,
Thank you for your patch.
This patch actually changes how the code works (se below),
so NACK to this patch.
On 9/13/22 15:06, Kang Minchul wrote:
> This commit cleans up checkpatch warning as follows:Hi,
> WARNING: braces {} are not necessary for single statement blocks
>
> Signed-off-by: Kang Minchul <tegongkang@gmail.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_recv.c | 19 ++++++-------------
> 1 file changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
> index d8d394b67eeb..f20eba7fa471 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
> @@ -1374,9 +1374,8 @@ static signed int validate_80211w_mgmt(struct adapter *adapter, union recv_frame
> /* actual management data frame body */
> data_len = pattrib->pkt_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len;
> mgmt_DATA = rtw_zmalloc(data_len);
> - if (!mgmt_DATA) {
> + if (!mgmt_DATA)
> goto validate_80211w_fail;
> - }
> precv_frame = decryptor(adapter, precv_frame);
> /* save actual management data frame body */
> memcpy(mgmt_DATA, ptr+pattrib->hdrlen+pattrib->iv_len, data_len);
> @@ -1385,9 +1384,8 @@ static signed int validate_80211w_mgmt(struct adapter *adapter, union recv_frame
> /* remove the iv and icv length */
> pattrib->pkt_len = pattrib->pkt_len - pattrib->iv_len - pattrib->icv_len;
> kfree(mgmt_DATA);
> - if (!precv_frame) {
> + if (!precv_frame)
> goto validate_80211w_fail;
> - }
> } else if (IS_MCAST(GetAddr1Ptr(ptr)) &&
> (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC)) {
> signed int BIP_ret = _SUCCESS;
> @@ -1651,14 +1649,12 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
> u16 wend = (preorder_ctrl->indicate_seq + wsize - 1) & 0xFFF;/* 4096; */
>
> /* Rx Reorder initialize condition. */
> - if (preorder_ctrl->indicate_seq == 0xFFFF) {
> + if (preorder_ctrl->indicate_seq == 0xFFFF)
> preorder_ctrl->indicate_seq = seq_num;
> - }
>
> /* Drop out the packet which SeqNum is smaller than WinStart */
> - if (SN_LESS(seq_num, preorder_ctrl->indicate_seq)) {
> + if (SN_LESS(seq_num, preorder_ctrl->indicate_seq))
> return false;
> - }
>
> /* */
> /* Sliding window manipulation. Conditions includes: */
> @@ -1862,8 +1858,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
>
> preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1)%4096;
>
> - if (retval != _SUCCESS) {
> - }
> + if (retval != _SUCCESS)
>
> return retval;
> }
This effectively changes the code from:
if (retval != _SUCCESSS) {
/* Do nothing */
}
return retval;
to:
if (retval != _SUCCESSS)
return retval;
/* continue executing next statements ! */
So now when value == _SUCCESS execution will continue instead of returning
_SUCCESS, changing how the code works.
Regards,
Hans
> @@ -2084,10 +2079,8 @@ s32 rtw_recv_entry(union recv_frame *precvframe)
> precvpriv = &padapter->recvpriv;
>
> ret = recv_func(padapter, precvframe);
> - if (ret == _FAIL) {
> + if (ret == _FAIL)
> goto _recv_entry_drop;
> - }
> -
>
> precvpriv->rx_pkts++;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] staging: rtl8723bs: remove braces in single statement blocks
2022-09-13 14:34 ` Hans de Goede
@ 2022-09-13 16:25 ` Kang Minchul
2022-09-13 16:31 ` 강민철
2022-09-13 17:03 ` Hans de Goede
0 siblings, 2 replies; 5+ messages in thread
From: Kang Minchul @ 2022-09-13 16:25 UTC (permalink / raw)
To: gregkh, hdegoede; +Cc: linux-staging, Kang Minchul
This commit cleans up checkpatch warning as follows:
WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: Kang Minchul <tegongkang@gmail.com>
---
Reverted erased code which invokes error.
drivers/staging/rtl8723bs/core/rtw_recv.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index d8d394b67eeb..f360c7c631cb 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -1374,9 +1374,8 @@ static signed int validate_80211w_mgmt(struct adapter *adapter, union recv_frame
/* actual management data frame body */
data_len = pattrib->pkt_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len;
mgmt_DATA = rtw_zmalloc(data_len);
- if (!mgmt_DATA) {
+ if (!mgmt_DATA)
goto validate_80211w_fail;
- }
precv_frame = decryptor(adapter, precv_frame);
/* save actual management data frame body */
memcpy(mgmt_DATA, ptr+pattrib->hdrlen+pattrib->iv_len, data_len);
@@ -1385,9 +1384,8 @@ static signed int validate_80211w_mgmt(struct adapter *adapter, union recv_frame
/* remove the iv and icv length */
pattrib->pkt_len = pattrib->pkt_len - pattrib->iv_len - pattrib->icv_len;
kfree(mgmt_DATA);
- if (!precv_frame) {
+ if (!precv_frame)
goto validate_80211w_fail;
- }
} else if (IS_MCAST(GetAddr1Ptr(ptr)) &&
(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC)) {
signed int BIP_ret = _SUCCESS;
@@ -1651,14 +1649,12 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
u16 wend = (preorder_ctrl->indicate_seq + wsize - 1) & 0xFFF;/* 4096; */
/* Rx Reorder initialize condition. */
- if (preorder_ctrl->indicate_seq == 0xFFFF) {
+ if (preorder_ctrl->indicate_seq == 0xFFFF)
preorder_ctrl->indicate_seq = seq_num;
- }
/* Drop out the packet which SeqNum is smaller than WinStart */
- if (SN_LESS(seq_num, preorder_ctrl->indicate_seq)) {
+ if (SN_LESS(seq_num, preorder_ctrl->indicate_seq))
return false;
- }
/* */
/* Sliding window manipulation. Conditions includes: */
@@ -2084,10 +2080,8 @@ s32 rtw_recv_entry(union recv_frame *precvframe)
precvpriv = &padapter->recvpriv;
ret = recv_func(padapter, precvframe);
- if (ret == _FAIL) {
+ if (ret == _FAIL)
goto _recv_entry_drop;
- }
-
precvpriv->rx_pkts++;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] staging: rtl8723bs: remove braces in single statement blocks
2022-09-13 16:25 ` [PATCH v2] " Kang Minchul
@ 2022-09-13 16:31 ` 강민철
2022-09-13 17:03 ` Hans de Goede
1 sibling, 0 replies; 5+ messages in thread
From: 강민철 @ 2022-09-13 16:31 UTC (permalink / raw)
To: gregkh, hdegoede; +Cc: linux-staging
Thanks for your kind review!
Regards,
Kang
2022년 9월 14일 (수) 오전 1:25, Kang Minchul <tegongkang@gmail.com>님이 작성:
>
> This commit cleans up checkpatch warning as follows:
> WARNING: braces {} are not necessary for single statement blocks
>
> Signed-off-by: Kang Minchul <tegongkang@gmail.com>
> ---
> Reverted erased code which invokes error.
>
> drivers/staging/rtl8723bs/core/rtw_recv.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
> index d8d394b67eeb..f360c7c631cb 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
> @@ -1374,9 +1374,8 @@ static signed int validate_80211w_mgmt(struct adapter *adapter, union recv_frame
> /* actual management data frame body */
> data_len = pattrib->pkt_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len;
> mgmt_DATA = rtw_zmalloc(data_len);
> - if (!mgmt_DATA) {
> + if (!mgmt_DATA)
> goto validate_80211w_fail;
> - }
> precv_frame = decryptor(adapter, precv_frame);
> /* save actual management data frame body */
> memcpy(mgmt_DATA, ptr+pattrib->hdrlen+pattrib->iv_len, data_len);
> @@ -1385,9 +1384,8 @@ static signed int validate_80211w_mgmt(struct adapter *adapter, union recv_frame
> /* remove the iv and icv length */
> pattrib->pkt_len = pattrib->pkt_len - pattrib->iv_len - pattrib->icv_len;
> kfree(mgmt_DATA);
> - if (!precv_frame) {
> + if (!precv_frame)
> goto validate_80211w_fail;
> - }
> } else if (IS_MCAST(GetAddr1Ptr(ptr)) &&
> (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC)) {
> signed int BIP_ret = _SUCCESS;
> @@ -1651,14 +1649,12 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
> u16 wend = (preorder_ctrl->indicate_seq + wsize - 1) & 0xFFF;/* 4096; */
>
> /* Rx Reorder initialize condition. */
> - if (preorder_ctrl->indicate_seq == 0xFFFF) {
> + if (preorder_ctrl->indicate_seq == 0xFFFF)
> preorder_ctrl->indicate_seq = seq_num;
> - }
>
> /* Drop out the packet which SeqNum is smaller than WinStart */
> - if (SN_LESS(seq_num, preorder_ctrl->indicate_seq)) {
> + if (SN_LESS(seq_num, preorder_ctrl->indicate_seq))
> return false;
> - }
>
> /* */
> /* Sliding window manipulation. Conditions includes: */
> @@ -2084,10 +2080,8 @@ s32 rtw_recv_entry(union recv_frame *precvframe)
> precvpriv = &padapter->recvpriv;
>
> ret = recv_func(padapter, precvframe);
> - if (ret == _FAIL) {
> + if (ret == _FAIL)
> goto _recv_entry_drop;
> - }
> -
>
> precvpriv->rx_pkts++;
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] staging: rtl8723bs: remove braces in single statement blocks
2022-09-13 16:25 ` [PATCH v2] " Kang Minchul
2022-09-13 16:31 ` 강민철
@ 2022-09-13 17:03 ` Hans de Goede
1 sibling, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2022-09-13 17:03 UTC (permalink / raw)
To: Kang Minchul, gregkh; +Cc: linux-staging
Hi,
On 9/13/22 18:25, Kang Minchul wrote:
> This commit cleans up checkpatch warning as follows:
> WARNING: braces {} are not necessary for single statement blocks
>
> Signed-off-by: Kang Minchul <tegongkang@gmail.com>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> Reverted erased code which invokes error.
>
> drivers/staging/rtl8723bs/core/rtw_recv.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
> index d8d394b67eeb..f360c7c631cb 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
> @@ -1374,9 +1374,8 @@ static signed int validate_80211w_mgmt(struct adapter *adapter, union recv_frame
> /* actual management data frame body */
> data_len = pattrib->pkt_len - pattrib->hdrlen - pattrib->iv_len - pattrib->icv_len;
> mgmt_DATA = rtw_zmalloc(data_len);
> - if (!mgmt_DATA) {
> + if (!mgmt_DATA)
> goto validate_80211w_fail;
> - }
> precv_frame = decryptor(adapter, precv_frame);
> /* save actual management data frame body */
> memcpy(mgmt_DATA, ptr+pattrib->hdrlen+pattrib->iv_len, data_len);
> @@ -1385,9 +1384,8 @@ static signed int validate_80211w_mgmt(struct adapter *adapter, union recv_frame
> /* remove the iv and icv length */
> pattrib->pkt_len = pattrib->pkt_len - pattrib->iv_len - pattrib->icv_len;
> kfree(mgmt_DATA);
> - if (!precv_frame) {
> + if (!precv_frame)
> goto validate_80211w_fail;
> - }
> } else if (IS_MCAST(GetAddr1Ptr(ptr)) &&
> (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC)) {
> signed int BIP_ret = _SUCCESS;
> @@ -1651,14 +1649,12 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
> u16 wend = (preorder_ctrl->indicate_seq + wsize - 1) & 0xFFF;/* 4096; */
>
> /* Rx Reorder initialize condition. */
> - if (preorder_ctrl->indicate_seq == 0xFFFF) {
> + if (preorder_ctrl->indicate_seq == 0xFFFF)
> preorder_ctrl->indicate_seq = seq_num;
> - }
>
> /* Drop out the packet which SeqNum is smaller than WinStart */
> - if (SN_LESS(seq_num, preorder_ctrl->indicate_seq)) {
> + if (SN_LESS(seq_num, preorder_ctrl->indicate_seq))
> return false;
> - }
>
> /* */
> /* Sliding window manipulation. Conditions includes: */
> @@ -2084,10 +2080,8 @@ s32 rtw_recv_entry(union recv_frame *precvframe)
> precvpriv = &padapter->recvpriv;
>
> ret = recv_func(padapter, precvframe);
> - if (ret == _FAIL) {
> + if (ret == _FAIL)
> goto _recv_entry_drop;
> - }
> -
>
> precvpriv->rx_pkts++;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-09-13 17:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 13:06 [PATCH] staging: rtl8723bs: remove braces in single statement blocks Kang Minchul
2022-09-13 14:34 ` Hans de Goede
2022-09-13 16:25 ` [PATCH v2] " Kang Minchul
2022-09-13 16:31 ` 강민철
2022-09-13 17:03 ` Hans de Goede
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.