[v2,4/6] staging: vt6655: refactor long lines of code in s_vGenerateTxParameter

Message ID 03dd39114b1e5c029cd8022245403a079ff03ae7.1666347511.git.tanjubrunostar0@gmail.com
State New
Headers
Series a series of checkpatch fixes on the file: rxtx.c |

Commit Message

Tanjuate Brunostar Oct. 21, 2022, 10:33 a.m. UTC
  fix checkpatch errors by refactoring long lines of code in the function: s_vGenerateTxParameter

Signed-off-by: Tanjuate Brunostar <tanjubrunostar0@gmail.com>
---
 drivers/staging/vt6655/rxtx.c | 70 ++++++++++++++++++++++++-----------
 1 file changed, 48 insertions(+), 22 deletions(-)
  

Comments

Philipp Hortmann Oct. 21, 2022, 4:52 p.m. UTC | #1
On 10/21/22 12:33, Tanjuate Brunostar wrote:
> fix checkpatch errors by refactoring long lines of code in the function: s_vGenerateTxParameter
> 
> Signed-off-by: Tanjuate Brunostar <tanjubrunostar0@gmail.com>
> ---
>   drivers/staging/vt6655/rxtx.c | 70 ++++++++++++++++++++++++-----------
>   1 file changed, 48 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> index dc853b83459b..42f4261293ba 100644
> --- a/drivers/staging/vt6655/rxtx.c
> +++ b/drivers/staging/vt6655/rxtx.c
> @@ -839,7 +839,8 @@ s_vFillCTSHead(struct vnt_private *pDevice,
>   	}
>   
>   	if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
> -		if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
> +		if (byFBOption != AUTO_FB_NONE && uDMAIdx !=
> +		    TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
>   			/* Auto Fall back */
>   			struct vnt_cts_fb *buf = pvCTS;
>   			/* Get SignalField, ServiceField & Length */
> @@ -878,7 +879,10 @@ s_vFillCTSHead(struct vnt_private *pDevice,
>   
>   			ether_addr_copy(buf->data.ra,
>   					pDevice->abyCurrentNetAddr);
> -		} else { /* if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) */
> +		} else {
> +			/* if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA &&
> +			 * uDMAIdx != TYPE_BEACONDMA)
> +			 */
>   			struct vnt_cts *buf = pvCTS;
>   			/* Get SignalField, ServiceField & Length */
>   			vnt_get_phy_field(pDevice, uCTSFrameLen,
> @@ -964,50 +968,72 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
>   			/* Fill RsvTime */
>   			struct vnt_rrv_time_rts *buf = pvRrvTime;
>   
> -			buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate);
> -			buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize, wCurrentRate);
> -			buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate);
> -			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);
> +			buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
> +							       wCurrentRate);
> +			buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize,
> +							       wCurrentRate);
> +			buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
> +							       wCurrentRate);
> +			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);
>   		} else {/* RTS_needless, PCF mode */
>   			struct vnt_rrv_time_cts *buf = pvRrvTime;
>   
> -			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);
> -			buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize, wCurrentRate);
> +			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);
> +			buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize,
> +							       wCurrentRate);
>   
>   			/* Fill CTS */
> -			s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK, bDisCRC, wCurrentRate, byFBOption);
> +			s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK,
> +				       bDisCRC, wCurrentRate, byFBOption);
>   		}
>   	} else if (byPktType == PK_TYPE_11A) {
>   		if (pvRTS) {/* RTS_need, non PCF mode */
> -			struct vnt_rrv_time_ab *buf = pvRrvTime;

Error during compiliation in next line

> +			struct vnt_rrv_time_ab *buf = pvRrvT
> +				ime;

make: Entering directory '/home/kernel/Documents/git/kernels/staging'
   CC [M]  drivers/staging/vt6655/rxtx.o
drivers/staging/vt6655/rxtx.c: In function ‘s_vGenerateTxParameter’:
drivers/staging/vt6655/rxtx.c:1014:34: error: ‘pvRrvT’ undeclared (first 
use in this function)
  1014 |    struct vnt_rrv_time_ab *buf = pvRrvT
       |                                  ^~~~~~
drivers/staging/vt6655/rxtx.c:1014:34: note: each undeclared identifier 
is reported only once for each function it appears in
drivers/staging/vt6655/rxtx.c:1015:5: error: expected ‘,’ or ‘;’ before 
‘ime’
  1015 |     ime;
       |     ^~~
make[1]: *** [scripts/Makefile.build:250: drivers/staging/vt6655/rxtx.o] 
Error 1
make: *** [Makefile:1992: drivers/staging/vt6655] Error 2
make: Leaving directory '/home/kernel/Documents/git/kernels/staging'

>   
> -			buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate);
> -			buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK);
> +			buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
> +							    wCurrentRate);
> +			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);
> +			s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
> +				       psEthHeader, wCurrentRate, byFBOption);
>   		} else if (!pvRTS) {/* RTS_needless, non PCF mode */
>   			struct vnt_rrv_time_ab *buf = pvRrvTime;
>   
> -			buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK);
> +			buf->rrv_time =
> +				vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize,
> +						      wCurrentRate, bNeedACK);
>   		}
>   	} else if (byPktType == PK_TYPE_11B) {
>   		if (pvRTS) {/* RTS_need, non PCF mode */
>   			struct vnt_rrv_time_ab *buf = pvRrvTime;
>   
> -			buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate);
> -			buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK);
> +			buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
> +							    wCurrentRate);
> +			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);
> +			s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
> +				       psEthHeader, wCurrentRate, byFBOption);
>   		} else { /* RTS_needless, non PCF mode */
>   			struct vnt_rrv_time_ab *buf = pvRrvTime;
>   
> -			buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK);
> +			buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
> +							      wCurrentRate, bNeedACK);
>   		}
>   	}
>   }
  
Tanjuate Brunostar Oct. 21, 2022, 6:08 p.m. UTC | #2
On Fri, Oct 21, 2022 at 5:52 PM Philipp Hortmann
<philipp.g.hortmann@gmail.com> wrote:
>
> On 10/21/22 12:33, Tanjuate Brunostar wrote:
> > fix checkpatch errors by refactoring long lines of code in the function: s_vGenerateTxParameter
> >
> > Signed-off-by: Tanjuate Brunostar <tanjubrunostar0@gmail.com>
> > ---
> >   drivers/staging/vt6655/rxtx.c | 70 ++++++++++++++++++++++++-----------
> >   1 file changed, 48 insertions(+), 22 deletions(-)
> >
> > diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> > index dc853b83459b..42f4261293ba 100644
> > --- a/drivers/staging/vt6655/rxtx.c
> > +++ b/drivers/staging/vt6655/rxtx.c
> > @@ -839,7 +839,8 @@ s_vFillCTSHead(struct vnt_private *pDevice,
> >       }
> >
> >       if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
> > -             if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
> > +             if (byFBOption != AUTO_FB_NONE && uDMAIdx !=
> > +                 TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
> >                       /* Auto Fall back */
> >                       struct vnt_cts_fb *buf = pvCTS;
> >                       /* Get SignalField, ServiceField & Length */
> > @@ -878,7 +879,10 @@ s_vFillCTSHead(struct vnt_private *pDevice,
> >
> >                       ether_addr_copy(buf->data.ra,
> >                                       pDevice->abyCurrentNetAddr);
> > -             } else { /* if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) */
> > +             } else {
> > +                     /* if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA &&
> > +                      * uDMAIdx != TYPE_BEACONDMA)
> > +                      */
> >                       struct vnt_cts *buf = pvCTS;
> >                       /* Get SignalField, ServiceField & Length */
> >                       vnt_get_phy_field(pDevice, uCTSFrameLen,
> > @@ -964,50 +968,72 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
> >                       /* Fill RsvTime */
> >                       struct vnt_rrv_time_rts *buf = pvRrvTime;
> >
> > -                     buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate);
> > -                     buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize, wCurrentRate);
> > -                     buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate);
> > -                     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);
> > +                     buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
> > +                                                            wCurrentRate);
> > +                     buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize,
> > +                                                            wCurrentRate);
> > +                     buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
> > +                                                            wCurrentRate);
> > +                     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);
> >               } else {/* RTS_needless, PCF mode */
> >                       struct vnt_rrv_time_cts *buf = pvRrvTime;
> >
> > -                     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);
> > -                     buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize, wCurrentRate);
> > +                     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);
> > +                     buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize,
> > +                                                            wCurrentRate);
> >
> >                       /* Fill CTS */
> > -                     s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK, bDisCRC, wCurrentRate, byFBOption);
> > +                     s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK,
> > +                                    bDisCRC, wCurrentRate, byFBOption);
> >               }
> >       } else if (byPktType == PK_TYPE_11A) {
> >               if (pvRTS) {/* RTS_need, non PCF mode */
> > -                     struct vnt_rrv_time_ab *buf = pvRrvTime;
>
> Error during compiliation in next line
>
> > +                     struct vnt_rrv_time_ab *buf = pvRrvT
> > +                             ime;
>
> make: Entering directory '/home/kernel/Documents/git/kernels/staging'
>    CC [M]  drivers/staging/vt6655/rxtx.o
> drivers/staging/vt6655/rxtx.c: In function ‘s_vGenerateTxParameter’:
> drivers/staging/vt6655/rxtx.c:1014:34: error: ‘pvRrvT’ undeclared (first
> use in this function)
>   1014 |    struct vnt_rrv_time_ab *buf = pvRrvT
>        |                                  ^~~~~~
> drivers/staging/vt6655/rxtx.c:1014:34: note: each undeclared identifier
> is reported only once for each function it appears in
> drivers/staging/vt6655/rxtx.c:1015:5: error: expected ‘,’ or ‘;’ before
> ‘ime’
>   1015 |     ime;
>        |     ^~~
> make[1]: *** [scripts/Makefile.build:250: drivers/staging/vt6655/rxtx.o]
> Error 1
> make: *** [Makefile:1992: drivers/staging/vt6655] Error 2
> make: Leaving directory '/home/kernel/Documents/git/kernels/staging'
>
This error occured on the first version of this patch. I corrected it,
compiled the code and the error was gone before I sent this version.
please check again. You may have seen this error on the first version
and not this one.
thanks

Tanju
> >
> > -                     buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate);
> > -                     buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK);
> > +                     buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
> > +                                                         wCurrentRate);
> > +                     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);
> > +                     s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
> > +                                    psEthHeader, wCurrentRate, byFBOption);
> >               } else if (!pvRTS) {/* RTS_needless, non PCF mode */
> >                       struct vnt_rrv_time_ab *buf = pvRrvTime;
> >
> > -                     buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK);
> > +                     buf->rrv_time =
> > +                             vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize,
> > +                                                   wCurrentRate, bNeedACK);
> >               }
> >       } else if (byPktType == PK_TYPE_11B) {
> >               if (pvRTS) {/* RTS_need, non PCF mode */
> >                       struct vnt_rrv_time_ab *buf = pvRrvTime;
> >
> > -                     buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate);
> > -                     buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK);
> > +                     buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
> > +                                                         wCurrentRate);
> > +                     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);
> > +                     s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
> > +                                    psEthHeader, wCurrentRate, byFBOption);
> >               } else { /* RTS_needless, non PCF mode */
> >                       struct vnt_rrv_time_ab *buf = pvRrvTime;
> >
> > -                     buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK);
> > +                     buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
> > +                                                           wCurrentRate, bNeedACK);
> >               }
> >       }
> >   }
>
  
Tanjuate Brunostar Oct. 21, 2022, 6:14 p.m. UTC | #3
On Fri, Oct 21, 2022 at 7:08 PM Tanju Brunostar
<tanjubrunostar0@gmail.com> wrote:
>
> On Fri, Oct 21, 2022 at 5:52 PM Philipp Hortmann
> <philipp.g.hortmann@gmail.com> wrote:
> >
> > On 10/21/22 12:33, Tanjuate Brunostar wrote:
> > > fix checkpatch errors by refactoring long lines of code in the function: s_vGenerateTxParameter
> > >
> > > Signed-off-by: Tanjuate Brunostar <tanjubrunostar0@gmail.com>
> > > ---
> > >   drivers/staging/vt6655/rxtx.c | 70 ++++++++++++++++++++++++-----------
> > >   1 file changed, 48 insertions(+), 22 deletions(-)
> > >
> > > diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> > > index dc853b83459b..42f4261293ba 100644
> > > --- a/drivers/staging/vt6655/rxtx.c
> > > +++ b/drivers/staging/vt6655/rxtx.c
> > > @@ -839,7 +839,8 @@ s_vFillCTSHead(struct vnt_private *pDevice,
> > >       }
> > >
> > >       if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
> > > -             if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
> > > +             if (byFBOption != AUTO_FB_NONE && uDMAIdx !=
> > > +                 TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
> > >                       /* Auto Fall back */
> > >                       struct vnt_cts_fb *buf = pvCTS;
> > >                       /* Get SignalField, ServiceField & Length */
> > > @@ -878,7 +879,10 @@ s_vFillCTSHead(struct vnt_private *pDevice,
> > >
> > >                       ether_addr_copy(buf->data.ra,
> > >                                       pDevice->abyCurrentNetAddr);
> > > -             } else { /* if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) */
> > > +             } else {
> > > +                     /* if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA &&
> > > +                      * uDMAIdx != TYPE_BEACONDMA)
> > > +                      */
> > >                       struct vnt_cts *buf = pvCTS;
> > >                       /* Get SignalField, ServiceField & Length */
> > >                       vnt_get_phy_field(pDevice, uCTSFrameLen,
> > > @@ -964,50 +968,72 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
> > >                       /* Fill RsvTime */
> > >                       struct vnt_rrv_time_rts *buf = pvRrvTime;
> > >
> > > -                     buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate);
> > > -                     buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize, wCurrentRate);
> > > -                     buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate);
> > > -                     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);
> > > +                     buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
> > > +                                                            wCurrentRate);
> > > +                     buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize,
> > > +                                                            wCurrentRate);
> > > +                     buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
> > > +                                                            wCurrentRate);
> > > +                     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);
> > >               } else {/* RTS_needless, PCF mode */
> > >                       struct vnt_rrv_time_cts *buf = pvRrvTime;
> > >
> > > -                     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);
> > > -                     buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize, wCurrentRate);
> > > +                     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);
> > > +                     buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize,
> > > +                                                            wCurrentRate);
> > >
> > >                       /* Fill CTS */
> > > -                     s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK, bDisCRC, wCurrentRate, byFBOption);
> > > +                     s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK,
> > > +                                    bDisCRC, wCurrentRate, byFBOption);
> > >               }
> > >       } else if (byPktType == PK_TYPE_11A) {
> > >               if (pvRTS) {/* RTS_need, non PCF mode */
> > > -                     struct vnt_rrv_time_ab *buf = pvRrvTime;
> >
> > Error during compiliation in next line
> >
> > > +                     struct vnt_rrv_time_ab *buf = pvRrvT
> > > +                             ime;
> >
> > make: Entering directory '/home/kernel/Documents/git/kernels/staging'
> >    CC [M]  drivers/staging/vt6655/rxtx.o
> > drivers/staging/vt6655/rxtx.c: In function ‘s_vGenerateTxParameter’:
> > drivers/staging/vt6655/rxtx.c:1014:34: error: ‘pvRrvT’ undeclared (first
> > use in this function)
> >   1014 |    struct vnt_rrv_time_ab *buf = pvRrvT
> >        |                                  ^~~~~~
> > drivers/staging/vt6655/rxtx.c:1014:34: note: each undeclared identifier
> > is reported only once for each function it appears in
> > drivers/staging/vt6655/rxtx.c:1015:5: error: expected ‘,’ or ‘;’ before
> > ‘ime’
> >   1015 |     ime;
> >        |     ^~~
> > make[1]: *** [scripts/Makefile.build:250: drivers/staging/vt6655/rxtx.o]
> > Error 1
> > make: *** [Makefile:1992: drivers/staging/vt6655] Error 2
> > make: Leaving directory '/home/kernel/Documents/git/kernels/staging'
> >
> This error occured on the first version of this patch. I corrected it,
> compiled the code and the error was gone before I sent this version.
> please check again. You may have seen this error on the first version
> and not this one.
> thanks
>
> Tanju
On the first patch, this error was detected by the kernel bot. This
time around, the kernel bot did not detect it, meaning it was fixed.
> > >
> > > -                     buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate);
> > > -                     buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK);
> > > +                     buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
> > > +                                                         wCurrentRate);
> > > +                     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);
> > > +                     s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
> > > +                                    psEthHeader, wCurrentRate, byFBOption);
> > >               } else if (!pvRTS) {/* RTS_needless, non PCF mode */
> > >                       struct vnt_rrv_time_ab *buf = pvRrvTime;
> > >
> > > -                     buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK);
> > > +                     buf->rrv_time =
> > > +                             vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize,
> > > +                                                   wCurrentRate, bNeedACK);
> > >               }
> > >       } else if (byPktType == PK_TYPE_11B) {
> > >               if (pvRTS) {/* RTS_need, non PCF mode */
> > >                       struct vnt_rrv_time_ab *buf = pvRrvTime;
> > >
> > > -                     buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate);
> > > -                     buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK);
> > > +                     buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
> > > +                                                         wCurrentRate);
> > > +                     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);
> > > +                     s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
> > > +                                    psEthHeader, wCurrentRate, byFBOption);
> > >               } else { /* RTS_needless, non PCF mode */
> > >                       struct vnt_rrv_time_ab *buf = pvRrvTime;
> > >
> > > -                     buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK);
> > > +                     buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
> > > +                                                           wCurrentRate, bNeedACK);
> > >               }
> > >       }
> > >   }
> >
  
Philipp Hortmann Oct. 22, 2022, 4:39 a.m. UTC | #4
On 10/21/22 20:14, Tanju Brunostar wrote:
>>> Error during compiliation in next line
>>>
>>>> +                     struct vnt_rrv_time_ab *buf = pvRrvT
>>>> +                             ime;
>>> make: Entering directory '/home/kernel/Documents/git/kernels/staging'
>>>     CC [M]  drivers/staging/vt6655/rxtx.o
>>> drivers/staging/vt6655/rxtx.c: In function ‘s_vGenerateTxParameter’:
>>> drivers/staging/vt6655/rxtx.c:1014:34: error: ‘pvRrvT’ undeclared (first
>>> use in this function)
>>>    1014 |    struct vnt_rrv_time_ab *buf = pvRrvT
>>>         |                                  ^~~~~~
>>> drivers/staging/vt6655/rxtx.c:1014:34: note: each undeclared identifier
>>> is reported only once for each function it appears in
>>> drivers/staging/vt6655/rxtx.c:1015:5: error: expected ‘,’ or ‘;’ before
>>> ‘ime’
>>>    1015 |     ime;
>>>         |     ^~~
>>> make[1]: *** [scripts/Makefile.build:250: drivers/staging/vt6655/rxtx.o]
>>> Error 1
>>> make: *** [Makefile:1992: drivers/staging/vt6655] Error 2
>>> make: Leaving directory '/home/kernel/Documents/git/kernels/staging'
>>>
>> This error occured on the first version of this patch. I corrected it,
>> compiled the code and the error was gone before I sent this version.
>> please check again. You may have seen this error on the first version
>> and not this one.
>> thanks
>>
>> Tanju
> On the first patch, this error was detected by the kernel bot. This
> time around, the kernel bot did not detect it, meaning it was fixed.

Please check the outbox of your email account and have a look. This is 
the v2 Patch and it contains this two lines:
 >>>> +                     struct vnt_rrv_time_ab *buf = pvRrvT
 >>>> +                             ime;
which do not compile.

Bye Philipp
  
Tanjuate Brunostar Oct. 22, 2022, 5:49 a.m. UTC | #5
On Sat, Oct 22, 2022 at 5:39 AM Philipp Hortmann
<philipp.g.hortmann@gmail.com> wrote:
>
> On 10/21/22 20:14, Tanju Brunostar wrote:
> >>> Error during compiliation in next line
> >>>
> >>>> +                     struct vnt_rrv_time_ab *buf = pvRrvT
> >>>> +                             ime;
> >>> make: Entering directory '/home/kernel/Documents/git/kernels/staging'
> >>>     CC [M]  drivers/staging/vt6655/rxtx.o
> >>> drivers/staging/vt6655/rxtx.c: In function ‘s_vGenerateTxParameter’:
> >>> drivers/staging/vt6655/rxtx.c:1014:34: error: ‘pvRrvT’ undeclared (first
> >>> use in this function)
> >>>    1014 |    struct vnt_rrv_time_ab *buf = pvRrvT
> >>>         |                                  ^~~~~~
> >>> drivers/staging/vt6655/rxtx.c:1014:34: note: each undeclared identifier
> >>> is reported only once for each function it appears in
> >>> drivers/staging/vt6655/rxtx.c:1015:5: error: expected ‘,’ or ‘;’ before
> >>> ‘ime’
> >>>    1015 |     ime;
> >>>         |     ^~~
> >>> make[1]: *** [scripts/Makefile.build:250: drivers/staging/vt6655/rxtx.o]
> >>> Error 1
> >>> make: *** [Makefile:1992: drivers/staging/vt6655] Error 2
> >>> make: Leaving directory '/home/kernel/Documents/git/kernels/staging'
> >>>
> >> This error occured on the first version of this patch. I corrected it,
> >> compiled the code and the error was gone before I sent this version.
> >> please check again. You may have seen this error on the first version
> >> and not this one.
> >> thanks
> >>
> >> Tanju
> > On the first patch, this error was detected by the kernel bot. This
> > time around, the kernel bot did not detect it, meaning it was fixed.
>
> Please check the outbox of your email account and have a look. This is
> the v2 Patch and it contains this two lines:
>  >>>> +                     struct vnt_rrv_time_ab *buf = pvRrvT
>  >>>> +                             ime;
> which do not compile.
>
> Bye Philipp
Oh you are right. I don't know how this is possible. I will send a
third version.
  

Patch

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index dc853b83459b..42f4261293ba 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -839,7 +839,8 @@  s_vFillCTSHead(struct vnt_private *pDevice,
 	}
 
 	if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
-		if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
+		if (byFBOption != AUTO_FB_NONE && uDMAIdx !=
+		    TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
 			/* Auto Fall back */
 			struct vnt_cts_fb *buf = pvCTS;
 			/* Get SignalField, ServiceField & Length */
@@ -878,7 +879,10 @@  s_vFillCTSHead(struct vnt_private *pDevice,
 
 			ether_addr_copy(buf->data.ra,
 					pDevice->abyCurrentNetAddr);
-		} else { /* if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) */
+		} else {
+			/* if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA &&
+			 * uDMAIdx != TYPE_BEACONDMA)
+			 */
 			struct vnt_cts *buf = pvCTS;
 			/* Get SignalField, ServiceField & Length */
 			vnt_get_phy_field(pDevice, uCTSFrameLen,
@@ -964,50 +968,72 @@  static void s_vGenerateTxParameter(struct vnt_private *pDevice,
 			/* Fill RsvTime */
 			struct vnt_rrv_time_rts *buf = pvRrvTime;
 
-			buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate);
-			buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize, wCurrentRate);
-			buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate);
-			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);
+			buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
+							       wCurrentRate);
+			buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize,
+							       wCurrentRate);
+			buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
+							       wCurrentRate);
+			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);
 		} else {/* RTS_needless, PCF mode */
 			struct vnt_rrv_time_cts *buf = pvRrvTime;
 
-			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);
-			buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize, wCurrentRate);
+			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);
+			buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize,
+							       wCurrentRate);
 
 			/* Fill CTS */
-			s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK, bDisCRC, wCurrentRate, byFBOption);
+			s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK,
+				       bDisCRC, wCurrentRate, byFBOption);
 		}
 	} else if (byPktType == PK_TYPE_11A) {
 		if (pvRTS) {/* RTS_need, non PCF mode */
-			struct vnt_rrv_time_ab *buf = pvRrvTime;
+			struct vnt_rrv_time_ab *buf = pvRrvT
+				ime;
 
-			buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize, wCurrentRate);
-			buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize, wCurrentRate, bNeedACK);
+			buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
+							    wCurrentRate);
+			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);
+			s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
+				       psEthHeader, wCurrentRate, byFBOption);
 		} else if (!pvRTS) {/* RTS_needless, non PCF mode */
 			struct vnt_rrv_time_ab *buf = pvRrvTime;
 
-			buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize, wCurrentRate, bNeedACK);
+			buf->rrv_time =
+				vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize,
+						      wCurrentRate, bNeedACK);
 		}
 	} else if (byPktType == PK_TYPE_11B) {
 		if (pvRTS) {/* RTS_need, non PCF mode */
 			struct vnt_rrv_time_ab *buf = pvRrvTime;
 
-			buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize, wCurrentRate);
-			buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK);
+			buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
+							    wCurrentRate);
+			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);
+			s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
+				       psEthHeader, wCurrentRate, byFBOption);
 		} else { /* RTS_needless, non PCF mode */
 			struct vnt_rrv_time_ab *buf = pvRrvTime;
 
-			buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize, wCurrentRate, bNeedACK);
+			buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
+							      wCurrentRate, bNeedACK);
 		}
 	}
 }