2022-10-22 09:21:48

by Tanjuate Brunostar

[permalink] [raw]
Subject: [PATCH v3 0/6] a series of checkpatch fixes on the file: rxtx.c

The fixes are similar, mostly long lines splitting. I had to make
serveral patches to ease the work of inspectors

v2: fixed a compilation error found by the kernel test robot and
recompiled the code

v3: tends out the error persisted in the second version. this version is
a correction of that

Tanjuate Brunostar (6):
staging: vt6655: fix lines ending in a '('
staging: vt6655: refactor long lines of code in s_uGetRTSCTSDuration
staging: vt6655: refactor long lines of code in s_uFillDataHead
staging: vt6655: refactor long lines of code in s_vGenerateTxParameter
staging: vt6655: refactor long lines of code in the rest of the file
staging: vt6655: refactor code to avoid a line ending in '('

drivers/staging/vt6655/rxtx.c | 532 ++++++++++++++++++++--------------
1 file changed, 321 insertions(+), 211 deletions(-)

--
2.34.1


2022-10-22 09:22:47

by Tanjuate Brunostar

[permalink] [raw]
Subject: [PATCH v3 2/6] staging: vt6655: refactor long lines of code in s_uGetRTSCTSDuration

fix checkpatch errors by refactoring long lines of code in the function: s_uGetRTSCTSDuration

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

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index f9d0b00d7cff..01e72999831b 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -188,20 +188,29 @@ static __le16 get_rtscts_time(struct vnt_private *priv,

data_time = bb_get_frame_time(priv->preamble_type, pkt_type, frame_length, current_rate);
if (rts_rsvtype == 0) { /* RTSTxRrvTime_bb */
- rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20, priv->byTopCCKBasicRate);
- ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopCCKBasicRate);
+ rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20,
+ priv->byTopCCKBasicRate);
+ ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->byTopCCKBasicRate);
cts_time = ack_time;
} else if (rts_rsvtype == 1) { /* RTSTxRrvTime_ba, only in 2.4GHZ */
- rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20, priv->byTopCCKBasicRate);
- cts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopCCKBasicRate);
- ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopOFDMBasicRate);
+ rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20,
+ priv->byTopCCKBasicRate);
+ cts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->byTopCCKBasicRate);
+ ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->byTopOFDMBasicRate);
} else if (rts_rsvtype == 2) { /* RTSTxRrvTime_aa */
- rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20, priv->byTopOFDMBasicRate);
- ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopOFDMBasicRate);
+ rts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 20,
+ priv->byTopOFDMBasicRate);
+ ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->byTopOFDMBasicRate);
cts_time = ack_time;
} else if (rts_rsvtype == 3) { /* CTSTxRrvTime_ba, only in 2.4GHZ */
- cts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopCCKBasicRate);
- ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14, priv->byTopOFDMBasicRate);
+ cts_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->byTopCCKBasicRate);
+ ack_time = bb_get_frame_time(priv->preamble_type, pkt_type, 14,
+ priv->byTopOFDMBasicRate);
rrv_time = cts_time + ack_time + data_time + 2 * priv->uSIFS;
return cpu_to_le16((u16)rrv_time);
}
@@ -323,73 +332,108 @@ static __le16 s_uGetRTSCTSDuration(struct vnt_private *pDevice,

switch (byDurType) {
case RTSDUR_BB: /* RTSDuration_bb */
- uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate);
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
+ uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14,
+ pDevice->byTopCCKBasicRate);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
break;

case RTSDUR_BA: /* RTSDuration_ba */
- uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate);
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
+ uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14,
+ pDevice->byTopCCKBasicRate);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
break;

case RTSDUR_AA: /* RTSDuration_aa */
- uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate);
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
+ uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14,
+ pDevice->byTopOFDMBasicRate);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
break;

case CTSDUR_BA: /* CTSDuration_ba */
- uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
+ uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType,
+ cbFrameLength, wRate, bNeedAck);
break;

case RTSDUR_BA_F0: /* RTSDuration_ba_f0 */
- uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate);
+ uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14,
+ pDevice->byTopCCKBasicRate);
if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);

break;

case RTSDUR_AA_F0: /* RTSDuration_aa_f0 */
- uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate);
+ uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14,
+ pDevice->byTopOFDMBasicRate);
if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);

break;

case RTSDUR_BA_F1: /* RTSDuration_ba_f1 */
- uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate);
+ uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14,
+ pDevice->byTopCCKBasicRate);
if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);

break;

case RTSDUR_AA_F1: /* RTSDuration_aa_f1 */
- uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate);
+ uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14,
+ pDevice->byTopOFDMBasicRate);
if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
+ uDurTime = uCTSTime + 2 * pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);

break;

case CTSDUR_BA_F0: /* CTSDuration_ba_f0 */
if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
+ uDurTime = pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck);
else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);
+ uDurTime = pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck);

break;

case CTSDUR_BA_F1: /* CTSDuration_ba_f1 */
if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
+ uDurTime = pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck);
else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M))
- uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);
+ uDurTime = pDevice->uSIFS +
+ s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength,
+ wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck);

break;

--
2.34.1

2022-10-22 09:28:29

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v3 2/6] staging: vt6655: refactor long lines of code in s_uGetRTSCTSDuration

On Sat, Oct 22, 2022 at 07:06:08AM +0000, Tanjuate Brunostar wrote:
> fix checkpatch errors by refactoring long lines of code in the function: s_uGetRTSCTSDuration

So your commit to fix a "too long of a line" has a changelog text line
that is "too long".

The irony is deep here...

thanks,

greg k-h

2022-10-22 09:38:22

by Tanjuate Brunostar

[permalink] [raw]
Subject: Re: [PATCH v3 0/6] a series of checkpatch fixes on the file: rxtx.c

On Sat, Oct 22, 2022 at 9:15 AM Greg KH <[email protected]> wrote:
>
> On Sat, Oct 22, 2022 at 07:06:06AM +0000, Tanjuate Brunostar wrote:
> > The fixes are similar, mostly long lines splitting. I had to make
> > serveral patches to ease the work of inspectors
> >
> > v2: fixed a compilation error found by the kernel test robot and
> > recompiled the code
> >
> > v3: tends out the error persisted in the second version. this version is
> > a correction of that
> >
> > Tanjuate Brunostar (6):
> > staging: vt6655: fix lines ending in a '('
> > staging: vt6655: refactor long lines of code in s_uGetRTSCTSDuration
> > staging: vt6655: refactor long lines of code in s_uFillDataHead
> > staging: vt6655: refactor long lines of code in s_vGenerateTxParameter
> > staging: vt6655: refactor long lines of code in the rest of the file
> > staging: vt6655: refactor code to avoid a line ending in '('
> >
> > drivers/staging/vt6655/rxtx.c | 532 ++++++++++++++++++++--------------
> > 1 file changed, 321 insertions(+), 211 deletions(-)
> >
> > --
> > 2.34.1
> >
> >
>
> Any reason you do not have "staging: vt6655:" as the prefix for this 0/X
> email subject line?
>
> thanks,
>
> greg k-h

oh I forgot to include it

2022-10-22 09:39:54

by Tanjuate Brunostar

[permalink] [raw]
Subject: Re: [PATCH v3 2/6] staging: vt6655: refactor long lines of code in s_uGetRTSCTSDuration

On Sat, Oct 22, 2022 at 9:17 AM Greg KH <[email protected]> wrote:
>
> On Sat, Oct 22, 2022 at 07:06:08AM +0000, Tanjuate Brunostar wrote:
> > fix checkpatch errors by refactoring long lines of code in the function: s_uGetRTSCTSDuration
>
> So your commit to fix a "too long of a line" has a changelog text line
> that is "too long".
>
> The irony is deep here...
>
> thanks,
>
> greg k-h

So true.

2022-10-22 09:56:27

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v3 0/6] a series of checkpatch fixes on the file: rxtx.c

On Sat, Oct 22, 2022 at 07:06:06AM +0000, Tanjuate Brunostar wrote:
> The fixes are similar, mostly long lines splitting. I had to make
> serveral patches to ease the work of inspectors
>
> v2: fixed a compilation error found by the kernel test robot and
> recompiled the code
>
> v3: tends out the error persisted in the second version. this version is
> a correction of that
>
> Tanjuate Brunostar (6):
> staging: vt6655: fix lines ending in a '('
> staging: vt6655: refactor long lines of code in s_uGetRTSCTSDuration
> staging: vt6655: refactor long lines of code in s_uFillDataHead
> staging: vt6655: refactor long lines of code in s_vGenerateTxParameter
> staging: vt6655: refactor long lines of code in the rest of the file
> staging: vt6655: refactor code to avoid a line ending in '('
>
> drivers/staging/vt6655/rxtx.c | 532 ++++++++++++++++++++--------------
> 1 file changed, 321 insertions(+), 211 deletions(-)
>
> --
> 2.34.1
>
>

Any reason you do not have "staging: vt6655:" as the prefix for this 0/X
email subject line?

thanks,

greg k-h