2022-10-27 06:15:56

by Tanjuate Brunostar

[permalink] [raw]
Subject: [PATCH v5 2/6] staging: vt6655: refactor 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 7eb7c6eb5cf0..8e56a7ee8035 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -186,20 +186,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);
}
@@ -320,73 +329,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-27 06:54:05

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v5 2/6] staging: vt6655: refactor code in s_uGetRTSCTSDuration

On Thu, Oct 27, 2022 at 06:01:26AM +0000, Tanjuate Brunostar wrote:
> fix checkpatch errors by refactoring long lines of code in the function: s_uGetRTSCTSDuration

Um, this is 93 characters long.

I don't see it changed from before :(

Please fix _ALL_ changelog texts...

greg k-h

2022-10-27 09:56:21

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v5 2/6] staging: vt6655: refactor code in s_uGetRTSCTSDuration

On Thu, Oct 27, 2022 at 08:59:04AM +0000, Tanjuate Brunostar wrote:
> refactor long lines of code in the function: s_uGetRTSCTSDuration

Please write full sentences.

Also please read the in-kernel documentation for how to write good
changelog text. Specifically look at the section entitled "The
canonical patch format" in the kernel file,
Documentation/SubmittingPatches for a description of how to do this
properly.

Do this for all of the patches in this series.

thanks,

greg k-h

2022-10-27 14:42:54

by Tanjuate Brunostar

[permalink] [raw]
Subject: Re: [PATCH v5 2/6] staging: vt6655: refactor code in s_uGetRTSCTSDuration

On Thu, Oct 27, 2022 at 10:19 AM Greg KH <[email protected]> wrote:
>
> On Thu, Oct 27, 2022 at 08:59:04AM +0000, Tanjuate Brunostar wrote:
> > refactor long lines of code in the function: s_uGetRTSCTSDuration
>
> Please write full sentences.
>
> Also please read the in-kernel documentation for how to write good
> changelog text. Specifically look at the section entitled "The
> canonical patch format" in the kernel file,
> Documentation/SubmittingPatches for a description of how to do this
> properly.
>
> Do this for all of the patches in this series.
>
> thanks,
>
> greg k-h

Hello Greg
the file does not exist in Documentations

Also, I had to make the sentences shorter because you said changelog
text was too long. Can you please give an example of a good changelog
text? I feel like I have not understood you.

thanks

Tanju

2022-10-27 15:28:37

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v5 2/6] staging: vt6655: refactor code in s_uGetRTSCTSDuration

On Thu, Oct 27, 2022 at 02:09:52PM +0100, Tanju Brunostar wrote:
> On Thu, Oct 27, 2022 at 10:19 AM Greg KH <[email protected]> wrote:
> >
> > On Thu, Oct 27, 2022 at 08:59:04AM +0000, Tanjuate Brunostar wrote:
> > > refactor long lines of code in the function: s_uGetRTSCTSDuration
> >
> > Please write full sentences.
> >
> > Also please read the in-kernel documentation for how to write good
> > changelog text. Specifically look at the section entitled "The
> > canonical patch format" in the kernel file,
> > Documentation/SubmittingPatches for a description of how to do this
> > properly.
> >
> > Do this for all of the patches in this series.
> >
> > thanks,
> >
> > greg k-h
>
> Hello Greg
> the file does not exist in Documentations

$ cat Documentation/SubmittingPatches
This file has moved to process/submitting-patches.rst

> Also, I had to make the sentences shorter because you said changelog
> text was too long.

You had too long of a single line. Wrap your lines.

Look at all of the changelogs for the driver itself as examples.

thanks,

greg k-h