* [PATCH 0/5] staging: r8188eu: Fixed some coding style issues
@ 2022-06-22 4:52 Chang Yu
2022-06-22 4:52 ` [PATCH 1/5] staging: r8188eu: Fixed a function declaration coding style issue Chang Yu
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Chang Yu @ 2022-06-22 4:52 UTC (permalink / raw)
To: Larry.Finger; +Cc: linux-staging, linux-kernel, Chang Yu
Fixed a few coding style issues as per checkpatch.pl and kernel coding
style guidelines.
Chang Yu (5):
staging: r8188eu: Fixed a function declaration coding style issue
staging: r8188eu: Fixed two brace coding style issues
staging: r8188eu: Fixed two whitespace coding style issues
staging: r8188eu: Fixed comment style
staging: r8188eu: Fixed some blank line coding style issues
drivers/staging/r8188eu/core/rtw_recv.c | 38 +++++++++++++++----------
1 file changed, 23 insertions(+), 15 deletions(-)
--
2.36.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/5] staging: r8188eu: Fixed a function declaration coding style issue
2022-06-22 4:52 [PATCH 0/5] staging: r8188eu: Fixed some coding style issues Chang Yu
@ 2022-06-22 4:52 ` Chang Yu
2022-06-22 9:32 ` Greg KH
2022-06-22 4:52 ` [PATCH 2/5] staging: r8188eu: Fixed two brace coding style issues Chang Yu
` (4 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Chang Yu @ 2022-06-22 4:52 UTC (permalink / raw)
To: Larry.Finger; +Cc: linux-staging, linux-kernel, Chang Yu
Added an identifier name for function definition argument
'struct timer_list *' as per checkpatch.pl
Note that for the same line checkpatch.pl will also complain "extern
should be avoided in .c". I am not very familiar with the codebase
so I decided not to move the declaration to a header file.
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
---
drivers/staging/r8188eu/core/rtw_recv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index 36ea79586992..7e2f5c2f9111 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -24,7 +24,7 @@ static u8 rtw_rfc1042_header[] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
};
-void rtw_signal_stat_timer_hdl(struct timer_list *);
+void rtw_signal_stat_timer_hdl(struct timer_list *t);
void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
{
--
2.36.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/5] staging: r8188eu: Fixed two brace coding style issues
2022-06-22 4:52 [PATCH 0/5] staging: r8188eu: Fixed some coding style issues Chang Yu
2022-06-22 4:52 ` [PATCH 1/5] staging: r8188eu: Fixed a function declaration coding style issue Chang Yu
@ 2022-06-22 4:52 ` Chang Yu
2022-06-22 4:52 ` [PATCH 3/5] staging: r8188eu: Fixed two whitespace " Chang Yu
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Chang Yu @ 2022-06-22 4:52 UTC (permalink / raw)
To: Larry.Finger; +Cc: linux-staging, linux-kernel, Chang Yu
Removed two pairs of unnecessary curly braces as per checkpatch.pl
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
---
drivers/staging/r8188eu/core/rtw_recv.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index 7e2f5c2f9111..38b7905dc88f 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -1365,13 +1365,12 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
a_len -= nSubframe_Length;
if (a_len != 0) {
padding_len = 4 - ((nSubframe_Length + ETH_HLEN) & (4 - 1));
- if (padding_len == 4) {
+ if (padding_len == 4)
padding_len = 0;
- }
- if (a_len < padding_len) {
+ if (a_len < padding_len)
goto exit;
- }
+
pdata += padding_len;
a_len -= padding_len;
}
--
2.36.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] staging: r8188eu: Fixed two whitespace coding style issues
2022-06-22 4:52 [PATCH 0/5] staging: r8188eu: Fixed some coding style issues Chang Yu
2022-06-22 4:52 ` [PATCH 1/5] staging: r8188eu: Fixed a function declaration coding style issue Chang Yu
2022-06-22 4:52 ` [PATCH 2/5] staging: r8188eu: Fixed two brace coding style issues Chang Yu
@ 2022-06-22 4:52 ` Chang Yu
2022-06-22 4:52 ` [PATCH 4/5] staging: r8188eu: Fixed comment style Chang Yu
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Chang Yu @ 2022-06-22 4:52 UTC (permalink / raw)
To: Larry.Finger; +Cc: linux-staging, linux-kernel, Chang Yu
Replaced spaces with tabs as per checkpatch.pl
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
---
drivers/staging/r8188eu/core/rtw_recv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index 38b7905dc88f..d42ff210ee81 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -17,11 +17,11 @@ static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};
/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
static u8 rtw_bridge_tunnel_header[] = {
- 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8
+ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8
};
static u8 rtw_rfc1042_header[] = {
- 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
+ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
};
void rtw_signal_stat_timer_hdl(struct timer_list *t);
--
2.36.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/5] staging: r8188eu: Fixed comment style
2022-06-22 4:52 [PATCH 0/5] staging: r8188eu: Fixed some coding style issues Chang Yu
` (2 preceding siblings ...)
2022-06-22 4:52 ` [PATCH 3/5] staging: r8188eu: Fixed two whitespace " Chang Yu
@ 2022-06-22 4:52 ` Chang Yu
2022-06-22 4:52 ` [PATCH 5/5] staging: r8188eu: Fixed some blank line coding style issues Chang Yu
2022-06-22 5:16 ` [PATCH 0/5] staging: r8188eu: Fixed some " Philipp Hortmann
5 siblings, 0 replies; 8+ messages in thread
From: Chang Yu @ 2022-06-22 4:52 UTC (permalink / raw)
To: Larry.Finger; +Cc: linux-staging, linux-kernel, Chang Yu
Fixed block comments style as per checkpatch.pl and kernel coding style
guide.
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
---
drivers/staging/r8188eu/core/rtw_recv.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index d42ff210ee81..14dd2344fa4b 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -204,12 +204,12 @@ int rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue)
}
/*
-caller : defrag ; recvframe_chk_defrag in recv_thread (passive)
-pframequeue: defrag_queue : will be accessed in recv_thread (passive)
-
-using spinlock to protect
-
-*/
+ * caller : defrag ; recvframe_chk_defrag in recv_thread (passive)
+ * pframequeue: defrag_queue : will be accessed in recv_thread (passive)
+ *
+ * using spinlock to protect
+ *
+ */
void rtw_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfree_recv_queue)
{
@@ -1745,9 +1745,11 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe)
!psecuritypriv->busetkipkey) {
rtw_enqueue_recvframe(rframe, &padapter->recvpriv.uc_swdec_pending_queue);
if (recvpriv->free_recvframe_cnt < NR_RECVFRAME / 4) {
- /* to prevent from recvframe starvation,
+ /*
+ * to prevent from recvframe starvation,
* get recvframe from uc_swdec_pending_queue to
- * free_recvframe_cnt */
+ * free_recvframe_cnt
+ */
rframe = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue);
if (rframe)
goto do_posthandle;
--
2.36.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/5] staging: r8188eu: Fixed some blank line coding style issues
2022-06-22 4:52 [PATCH 0/5] staging: r8188eu: Fixed some coding style issues Chang Yu
` (3 preceding siblings ...)
2022-06-22 4:52 ` [PATCH 4/5] staging: r8188eu: Fixed comment style Chang Yu
@ 2022-06-22 4:52 ` Chang Yu
2022-06-22 5:16 ` [PATCH 0/5] staging: r8188eu: Fixed some " Philipp Hortmann
5 siblings, 0 replies; 8+ messages in thread
From: Chang Yu @ 2022-06-22 4:52 UTC (permalink / raw)
To: Larry.Finger; +Cc: linux-staging, linux-kernel, Chang Yu
Added blank lines after variable declarations as per checkpatch.pl
Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
---
drivers/staging/r8188eu/core/rtw_recv.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index 14dd2344fa4b..cc91638a085d 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -237,6 +237,7 @@ u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter)
{
u32 cnt = 0;
struct recv_frame *pending_frame;
+
while ((pending_frame = rtw_alloc_recvframe(&adapter->recvpriv.uc_swdec_pending_queue))) {
rtw_free_recvframe(pending_frame, &adapter->recvpriv.free_recv_queue);
cnt++;
@@ -327,6 +328,7 @@ static struct recv_frame *decryptor(struct adapter *padapter, struct recv_frame
if (prxattrib->encrypt > 0) {
u8 *iv = precv_frame->rx_data + prxattrib->hdrlen;
+
prxattrib->key_index = (((iv[3]) >> 6) & 0x3);
if (prxattrib->key_index > WEP_KEYS) {
@@ -777,6 +779,7 @@ static int sta2ap_data_frame(struct adapter *adapter,
}
} else {
u8 *myhwaddr = myid(&adapter->eeprompriv);
+
if (memcmp(pattrib->ra, myhwaddr, ETH_ALEN)) {
ret = RTW_RX_HANDLED;
goto exit;
@@ -1022,6 +1025,7 @@ static int validate_recv_frame(struct adapter *adapter, struct recv_frame *precv
if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) {
int ch_set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, rtw_get_oper_ch(adapter));
+
if (ch_set_idx >= 0)
pmlmeext->channel_set[ch_set_idx].rx_count++;
}
@@ -1049,6 +1053,7 @@ static int validate_recv_frame(struct adapter *adapter, struct recv_frame *precv
retval = validate_recv_data_frame(adapter, precv_frame);
if (retval == _FAIL) {
struct recv_priv *precvpriv = &adapter->recvpriv;
+
precvpriv->rx_drop++;
}
}
@@ -1312,9 +1317,11 @@ static int amsdu_to_msdu(struct adapter *padapter, struct recv_frame *prframe)
struct rx_pkt_attrib *pattrib;
unsigned char *data_ptr;
struct sk_buff *sub_skb, *subframes[MAX_SUBFRAME_COUNT];
+
struct recv_priv *precvpriv = &padapter->recvpriv;
struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue;
int ret = _SUCCESS;
+
nr_subframes = 0;
pattrib = &prframe->attrib;
--
2.36.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 0/5] staging: r8188eu: Fixed some coding style issues
2022-06-22 4:52 [PATCH 0/5] staging: r8188eu: Fixed some coding style issues Chang Yu
` (4 preceding siblings ...)
2022-06-22 4:52 ` [PATCH 5/5] staging: r8188eu: Fixed some blank line coding style issues Chang Yu
@ 2022-06-22 5:16 ` Philipp Hortmann
5 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2022-06-22 5:16 UTC (permalink / raw)
To: Chang Yu, Larry.Finger; +Cc: linux-staging, linux-kernel
On 6/22/22 06:52, Chang Yu wrote:
> Fixed a few coding style issues as per checkpatch.pl and kernel coding
> style guidelines.
>
> Chang Yu (5):
> staging: r8188eu: Fixed a function declaration coding style issue
> staging: r8188eu: Fixed two brace coding style issues
> staging: r8188eu: Fixed two whitespace coding style issues
> staging: r8188eu: Fixed comment style
> staging: r8188eu: Fixed some blank line coding style issues
>
> drivers/staging/r8188eu/core/rtw_recv.c | 38 +++++++++++++++----------
> 1 file changed, 23 insertions(+), 15 deletions(-)
>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Adapter
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/5] staging: r8188eu: Fixed a function declaration coding style issue
2022-06-22 4:52 ` [PATCH 1/5] staging: r8188eu: Fixed a function declaration coding style issue Chang Yu
@ 2022-06-22 9:32 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2022-06-22 9:32 UTC (permalink / raw)
To: Chang Yu; +Cc: Larry.Finger, linux-staging, linux-kernel
On Tue, Jun 21, 2022 at 09:52:30PM -0700, Chang Yu wrote:
> Added an identifier name for function definition argument
> 'struct timer_list *' as per checkpatch.pl
>
> Note that for the same line checkpatch.pl will also complain "extern
> should be avoided in .c". I am not very familiar with the codebase
> so I decided not to move the declaration to a header file.
>
> Signed-off-by: Chang Yu <marcus.yu.56@gmail.com>
> ---
> drivers/staging/r8188eu/core/rtw_recv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
> index 36ea79586992..7e2f5c2f9111 100644
> --- a/drivers/staging/r8188eu/core/rtw_recv.c
> +++ b/drivers/staging/r8188eu/core/rtw_recv.c
> @@ -24,7 +24,7 @@ static u8 rtw_rfc1042_header[] = {
> 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
> };
>
> -void rtw_signal_stat_timer_hdl(struct timer_list *);
> +void rtw_signal_stat_timer_hdl(struct timer_list *t);
This really should be a static function, not a global one like this.
That is the correct fix to make, can you do that as an add-on patch?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-06-22 9:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22 4:52 [PATCH 0/5] staging: r8188eu: Fixed some coding style issues Chang Yu
2022-06-22 4:52 ` [PATCH 1/5] staging: r8188eu: Fixed a function declaration coding style issue Chang Yu
2022-06-22 9:32 ` Greg KH
2022-06-22 4:52 ` [PATCH 2/5] staging: r8188eu: Fixed two brace coding style issues Chang Yu
2022-06-22 4:52 ` [PATCH 3/5] staging: r8188eu: Fixed two whitespace " Chang Yu
2022-06-22 4:52 ` [PATCH 4/5] staging: r8188eu: Fixed comment style Chang Yu
2022-06-22 4:52 ` [PATCH 5/5] staging: r8188eu: Fixed some blank line coding style issues Chang Yu
2022-06-22 5:16 ` [PATCH 0/5] staging: r8188eu: Fixed some " Philipp Hortmann
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.