2022-11-01 11:18:49

by Tanjuate Brunostar

[permalink] [raw]
Subject: [PATCH 0/2] some checkpatch fixes in the file rxtx.c

These fixes are focused on the function s_vFillRTSHead

Tanjuate Brunostar (2):
change the function name s_vFillRTSHead
Join some lines of code to avoid code lines ending in (

drivers/staging/vt6655/rxtx.c | 48 ++++++++++++++++-------------------
1 file changed, 22 insertions(+), 26 deletions(-)

--
2.34.1



2022-11-01 11:20:34

by Tanjuate Brunostar

[permalink] [raw]
Subject: [PATCH 1/2] change the function name s_vFillRTSHead

Remove the use of Hungarian notation, which is not used in the Linux
kernel

Signed-off-by: Tanjuate Brunostar <[email protected]>
---
drivers/staging/vt6655/rxtx.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 31ae99b3cb35..d7e439cd8675 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -23,7 +23,7 @@
* s_uGetTxRsvTime- get frame reserved time
* s_vFillCTSHead- fulfill CTS ctl header
* s_vFillFragParameter- Set fragment ctl parameter.
- * s_vFillRTSHead- fulfill RTS ctl header
+ * fill_rts_head- fulfill RTS ctl header
* s_vFillTxKey- fulfill tx encrypt key
* s_vSWencryption- Software encrypt header
* vDMA0_tx_80211- tx 802.11 frame via dma0
@@ -85,15 +85,15 @@ static const unsigned short fb_opt1[2][5] = {
#define DATADUR_A_F1 13

/*--------------------- Static Functions --------------------------*/
-static void s_vFillRTSHead(struct vnt_private *pDevice,
- unsigned char byPktType,
- void *pvRTS,
- unsigned int cbFrameLength,
- bool bNeedAck,
- bool bDisCRC,
- struct ieee80211_hdr *hdr,
- unsigned short wCurrentRate,
- unsigned char byFBOption);
+static void fill_rts_head(struct vnt_private *pDevice,
+ unsigned char byPktType,
+ void *pvRTS,
+ unsigned int cbFrameLength,
+ bool bNeedAck,
+ bool bDisCRC,
+ struct ieee80211_hdr *hdr,
+ unsigned short wCurrentRate,
+ unsigned char byFBOption);

static void s_vGenerateTxParameter(struct vnt_private *pDevice,
unsigned char byPktType,
@@ -912,7 +912,7 @@ s_vGenerateTxParameter(
buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK);
buf->rrv_time_b = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK);

- s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
+ fill_rts_head(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
} else {/* RTS_needless, PCF mode */
struct vnt_rrv_time_cts *buf = pvRrvTime;

@@ -931,7 +931,7 @@ s_vGenerateTxParameter(
buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK);

/* Fill RTS */
- s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
+ fill_rts_head(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
} else if (!pvRTS) {/* RTS_needless, non PCF mode */
struct vnt_rrv_time_ab *buf = pvRrvTime;

@@ -945,7 +945,7 @@ s_vGenerateTxParameter(
buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK);

/* Fill RTS */
- s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
+ fill_rts_head(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
} else { /* RTS_needless, non PCF mode */
struct vnt_rrv_time_ab *buf = pvRrvTime;

--
2.34.1


2022-11-01 11:21:02

by Tanjuate Brunostar

[permalink] [raw]
Subject: [PATCH 2/2] Join some lines of code to avoid a line ending in a (

The code line ends with a '(' which is not allowed in
Linux kernel coding. Joining the lines and indenting
correctly improves visibility

Signed-off-by: Tanjuate Brunostar <[email protected]>
---
drivers/staging/vt6655/rxtx.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index d7e439cd8675..df7473155704 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -555,19 +555,15 @@ s_uFillDataHead(
return buf->duration;
}

-static
-void
-s_vFillRTSHead(
- struct vnt_private *pDevice,
- unsigned char byPktType,
- void *pvRTS,
- unsigned int cbFrameLength,
- bool bNeedAck,
- bool bDisCRC,
- struct ieee80211_hdr *hdr,
- unsigned short wCurrentRate,
- unsigned char byFBOption
-)
+static void fill_rts_head(struct vnt_private *pDevice,
+ unsigned char byPktType,
+ void *pvRTS,
+ unsigned int cbFrameLength,
+ bool bNeedAck,
+ bool bDisCRC,
+ struct ieee80211_hdr *hdr,
+ unsigned short wCurrentRate,
+ unsigned char byFBOption)
{
unsigned int uRTSFrameLen = 20;

--
2.34.1


2022-11-01 11:55:52

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH 2/2] Join some lines of code to avoid a line ending in a (



On Tue, 1 Nov 2022, Tanjuate Brunostar wrote:

> The code line ends with a '(' which is not allowed in
> Linux kernel coding. Joining the lines and indenting
> correctly improves visibility

I think Greg discouraged saying "not allowed by the coding style" and
instead encouraged thinking about the reason why the thing is not a good
idea and the change is helpful.

julia

>
> Signed-off-by: Tanjuate Brunostar <[email protected]>
> ---
> drivers/staging/vt6655/rxtx.c | 22 +++++++++-------------
> 1 file changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> index d7e439cd8675..df7473155704 100644
> --- a/drivers/staging/vt6655/rxtx.c
> +++ b/drivers/staging/vt6655/rxtx.c
> @@ -555,19 +555,15 @@ s_uFillDataHead(
> return buf->duration;
> }
>
> -static
> -void
> -s_vFillRTSHead(
> - struct vnt_private *pDevice,
> - unsigned char byPktType,
> - void *pvRTS,
> - unsigned int cbFrameLength,
> - bool bNeedAck,
> - bool bDisCRC,
> - struct ieee80211_hdr *hdr,
> - unsigned short wCurrentRate,
> - unsigned char byFBOption
> -)
> +static void fill_rts_head(struct vnt_private *pDevice,
> + unsigned char byPktType,
> + void *pvRTS,
> + unsigned int cbFrameLength,
> + bool bNeedAck,
> + bool bDisCRC,
> + struct ieee80211_hdr *hdr,
> + unsigned short wCurrentRate,
> + unsigned char byFBOption)
> {
> unsigned int uRTSFrameLen = 20;
>
> --
> 2.34.1
>
>
>

2022-11-01 12:31:16

by Julia Lawall

[permalink] [raw]
Subject: Re: [PATCH 1/2] change the function name s_vFillRTSHead



On Tue, 1 Nov 2022, Tanjuate Brunostar wrote:

> Remove the use of Hungarian notation, which is not used in the Linux
> kernel

Period at the end of the sentence. It woudl still be good to acknowledge
checkpatch.

julia

>
> Signed-off-by: Tanjuate Brunostar <[email protected]>
> ---
> drivers/staging/vt6655/rxtx.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> index 31ae99b3cb35..d7e439cd8675 100644
> --- a/drivers/staging/vt6655/rxtx.c
> +++ b/drivers/staging/vt6655/rxtx.c
> @@ -23,7 +23,7 @@
> * s_uGetTxRsvTime- get frame reserved time
> * s_vFillCTSHead- fulfill CTS ctl header
> * s_vFillFragParameter- Set fragment ctl parameter.
> - * s_vFillRTSHead- fulfill RTS ctl header
> + * fill_rts_head- fulfill RTS ctl header
> * s_vFillTxKey- fulfill tx encrypt key
> * s_vSWencryption- Software encrypt header
> * vDMA0_tx_80211- tx 802.11 frame via dma0
> @@ -85,15 +85,15 @@ static const unsigned short fb_opt1[2][5] = {
> #define DATADUR_A_F1 13
>
> /*--------------------- Static Functions --------------------------*/
> -static void s_vFillRTSHead(struct vnt_private *pDevice,
> - unsigned char byPktType,
> - void *pvRTS,
> - unsigned int cbFrameLength,
> - bool bNeedAck,
> - bool bDisCRC,
> - struct ieee80211_hdr *hdr,
> - unsigned short wCurrentRate,
> - unsigned char byFBOption);
> +static void fill_rts_head(struct vnt_private *pDevice,
> + unsigned char byPktType,
> + void *pvRTS,
> + unsigned int cbFrameLength,
> + bool bNeedAck,
> + bool bDisCRC,
> + struct ieee80211_hdr *hdr,
> + unsigned short wCurrentRate,
> + unsigned char byFBOption);
>
> static void s_vGenerateTxParameter(struct vnt_private *pDevice,
> unsigned char byPktType,
> @@ -912,7 +912,7 @@ s_vGenerateTxParameter(
> buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK);
> buf->rrv_time_b = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, pDevice->byTopCCKBasicRate, bNeedACK);
>
> - s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
> + fill_rts_head(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
> } else {/* RTS_needless, PCF mode */
> struct vnt_rrv_time_cts *buf = pvRrvTime;
>
> @@ -931,7 +931,7 @@ s_vGenerateTxParameter(
> buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK);
>
> /* Fill RTS */
> - s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
> + fill_rts_head(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
> } else if (!pvRTS) {/* RTS_needless, non PCF mode */
> struct vnt_rrv_time_ab *buf = pvRrvTime;
>
> @@ -945,7 +945,7 @@ s_vGenerateTxParameter(
> buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK);
>
> /* Fill RTS */
> - s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
> + fill_rts_head(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC, psEthHeader, wCurrentRate, byFBOption);
> } else { /* RTS_needless, non PCF mode */
> struct vnt_rrv_time_ab *buf = pvRrvTime;
>
> --
> 2.34.1
>
>
>