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

Message ID 03dd39114b1e5c029cd8022245403a079ff03ae7.1666288416.git.tanjubrunostar0@gmail.com
State New
Headers
Series staging: vt6655: a series of checkpatch fixes on |

Commit Message

Tanjuate Brunostar Oct. 20, 2022, 6:27 p.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

kernel test robot Oct. 20, 2022, 9:17 p.m. UTC | #1
Hi Tanjuate,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Tanjuate-Brunostar/staging-vt6655-a-series-of-checkpatch-fixes-on/20221021-023139
patch link:    https://lore.kernel.org/r/03dd39114b1e5c029cd8022245403a079ff03ae7.1666288416.git.tanjubrunostar0%40gmail.com
patch subject: [PATCH 4/6] staging: vt6655: refactor long lines of code in s_vGenerateTxParameter
config: ia64-allyesconfig
compiler: ia64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/15a1ddd8d558d352c2381105b7f025740f73ba00
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Tanjuate-Brunostar/staging-vt6655-a-series-of-checkpatch-fixes-on/20221021-023139
        git checkout 15a1ddd8d558d352c2381105b7f025740f73ba00
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/staging/vt6655/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/staging/vt6655/rxtx.c: In function 's_vGenerateTxParameter':
>> drivers/staging/vt6655/rxtx.c:1014:55: error: 'pvRrvT' undeclared (first use in this function)
    1014 |                         struct vnt_rrv_time_ab *buf = pvRrvT
         |                                                       ^~~~~~
   drivers/staging/vt6655/rxtx.c:1014:55: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/staging/vt6655/rxtx.c:1015:33: error: expected ',' or ';' before 'ime'
    1015 |                                 ime;
         |                                 ^~~


vim +/pvRrvT +1014 drivers/staging/vt6655/rxtx.c

   924	
   925	/*
   926	 *
   927	 * Description:
   928	 *      Generate FIFO control for MAC & Baseband controller
   929	 *
   930	 * Parameters:
   931	 *  In:
   932	 *      pDevice         - Pointer to adapter
   933	 *      pTxDataHead     - Transmit Data Buffer
   934	 *      pTxBufHead      - pTxBufHead
   935	 *      pvRrvTime        - pvRrvTime
   936	 *      pvRTS            - RTS Buffer
   937	 *      pCTS            - CTS Buffer
   938	 *      cbFrameSize     - Transmit Data Length (Hdr+Payload+FCS)
   939	 *      bNeedACK        - If need ACK
   940	 *      uDescIdx        - Desc Index
   941	 *  Out:
   942	 *      none
   943	 *
   944	 * Return Value: none
   945	 *
   946	 -
   947	 * unsigned int cbFrameSize, Hdr+Payload+FCS
   948	 */
   949	static void s_vGenerateTxParameter(struct vnt_private *pDevice,
   950					   unsigned char byPktType,
   951					   struct vnt_tx_fifo_head *tx_buffer_head,
   952					   void *pvRrvTime,
   953					   void *pvRTS,
   954					   void *pvCTS,
   955					   unsigned int cbFrameSize,
   956					   bool bNeedACK,
   957					   unsigned int uDMAIdx,
   958					   void *psEthHeader,
   959					   unsigned short wCurrentRate)
   960	{
   961		u16 fifo_ctl = le16_to_cpu(tx_buffer_head->fifo_ctl);
   962		bool bDisCRC = false;
   963		unsigned char byFBOption = AUTO_FB_NONE;
   964	
   965		tx_buffer_head->current_rate = cpu_to_le16(wCurrentRate);
   966	
   967		if (fifo_ctl & FIFOCTL_CRCDIS)
   968			bDisCRC = true;
   969	
   970		if (fifo_ctl & FIFOCTL_AUTO_FB_0)
   971			byFBOption = AUTO_FB_0;
   972		else if (fifo_ctl & FIFOCTL_AUTO_FB_1)
   973			byFBOption = AUTO_FB_1;
   974	
   975		if (!pvRrvTime)
   976			return;
   977	
   978		if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
   979			if (pvRTS) { /* RTS_need */
   980				/* Fill RsvTime */
   981				struct vnt_rrv_time_rts *buf = pvRrvTime;
   982	
   983				buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
   984								       wCurrentRate);
   985				buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize,
   986								       wCurrentRate);
   987				buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
   988								       wCurrentRate);
   989				buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize,
   990									wCurrentRate, bNeedACK);
   991				buf->rrv_time_b =
   992					vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
   993							      pDevice->byTopCCKBasicRate, bNeedACK);
   994	
   995				s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
   996					       psEthHeader, wCurrentRate, byFBOption);
   997			} else {/* RTS_needless, PCF mode */
   998				struct vnt_rrv_time_cts *buf = pvRrvTime;
   999	
  1000				buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize,
  1001									wCurrentRate, bNeedACK);
  1002				buf->rrv_time_b =
  1003					vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
  1004							      pDevice->byTopCCKBasicRate, bNeedACK);
  1005				buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize,
  1006								       wCurrentRate);
  1007	
  1008				/* Fill CTS */
  1009				s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK,
  1010					       bDisCRC, wCurrentRate, byFBOption);
  1011			}
  1012		} else if (byPktType == PK_TYPE_11A) {
  1013			if (pvRTS) {/* RTS_need, non PCF mode */
> 1014				struct vnt_rrv_time_ab *buf = pvRrvT
> 1015					ime;
  1016	
  1017				buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
  1018								    wCurrentRate);
  1019				buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize,
  1020								      wCurrentRate, bNeedACK);
  1021	
  1022				/* Fill RTS */
  1023				s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
  1024					       psEthHeader, wCurrentRate, byFBOption);
  1025			} else if (!pvRTS) {/* RTS_needless, non PCF mode */
  1026				struct vnt_rrv_time_ab *buf = pvRrvTime;
  1027	
  1028				buf->rrv_time =
  1029					vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize,
  1030							      wCurrentRate, bNeedACK);
  1031			}
  1032		} else if (byPktType == PK_TYPE_11B) {
  1033			if (pvRTS) {/* RTS_need, non PCF mode */
  1034				struct vnt_rrv_time_ab *buf = pvRrvTime;
  1035	
  1036				buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
  1037								    wCurrentRate);
  1038				buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
  1039								      wCurrentRate, bNeedACK);
  1040	
  1041				/* Fill RTS */
  1042				s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
  1043					       psEthHeader, wCurrentRate, byFBOption);
  1044			} else { /* RTS_needless, non PCF mode */
  1045				struct vnt_rrv_time_ab *buf = pvRrvTime;
  1046	
  1047				buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
  1048								      wCurrentRate, bNeedACK);
  1049			}
  1050		}
  1051	}
  1052
  
kernel test robot Oct. 21, 2022, 4:41 a.m. UTC | #2
Hi Tanjuate,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Tanjuate-Brunostar/staging-vt6655-a-series-of-checkpatch-fixes-on/20221021-023139
patch link:    https://lore.kernel.org/r/03dd39114b1e5c029cd8022245403a079ff03ae7.1666288416.git.tanjubrunostar0%40gmail.com
patch subject: [PATCH 4/6] staging: vt6655: refactor long lines of code in s_vGenerateTxParameter
config: x86_64-allmodconfig
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/15a1ddd8d558d352c2381105b7f025740f73ba00
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Tanjuate-Brunostar/staging-vt6655-a-series-of-checkpatch-fixes-on/20221021-023139
        git checkout 15a1ddd8d558d352c2381105b7f025740f73ba00
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/staging/vt6655/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/staging/vt6655/rxtx.c:1014:34: error: use of undeclared identifier 'pvRrvT'
                           struct vnt_rrv_time_ab *buf = pvRrvT
                                                         ^
>> drivers/staging/vt6655/rxtx.c:1014:40: error: expected ';' at end of declaration
                           struct vnt_rrv_time_ab *buf = pvRrvT
                                                               ^
                                                               ;
   2 errors generated.


vim +/pvRrvT +1014 drivers/staging/vt6655/rxtx.c

   924	
   925	/*
   926	 *
   927	 * Description:
   928	 *      Generate FIFO control for MAC & Baseband controller
   929	 *
   930	 * Parameters:
   931	 *  In:
   932	 *      pDevice         - Pointer to adapter
   933	 *      pTxDataHead     - Transmit Data Buffer
   934	 *      pTxBufHead      - pTxBufHead
   935	 *      pvRrvTime        - pvRrvTime
   936	 *      pvRTS            - RTS Buffer
   937	 *      pCTS            - CTS Buffer
   938	 *      cbFrameSize     - Transmit Data Length (Hdr+Payload+FCS)
   939	 *      bNeedACK        - If need ACK
   940	 *      uDescIdx        - Desc Index
   941	 *  Out:
   942	 *      none
   943	 *
   944	 * Return Value: none
   945	 *
   946	 -
   947	 * unsigned int cbFrameSize, Hdr+Payload+FCS
   948	 */
   949	static void s_vGenerateTxParameter(struct vnt_private *pDevice,
   950					   unsigned char byPktType,
   951					   struct vnt_tx_fifo_head *tx_buffer_head,
   952					   void *pvRrvTime,
   953					   void *pvRTS,
   954					   void *pvCTS,
   955					   unsigned int cbFrameSize,
   956					   bool bNeedACK,
   957					   unsigned int uDMAIdx,
   958					   void *psEthHeader,
   959					   unsigned short wCurrentRate)
   960	{
   961		u16 fifo_ctl = le16_to_cpu(tx_buffer_head->fifo_ctl);
   962		bool bDisCRC = false;
   963		unsigned char byFBOption = AUTO_FB_NONE;
   964	
   965		tx_buffer_head->current_rate = cpu_to_le16(wCurrentRate);
   966	
   967		if (fifo_ctl & FIFOCTL_CRCDIS)
   968			bDisCRC = true;
   969	
   970		if (fifo_ctl & FIFOCTL_AUTO_FB_0)
   971			byFBOption = AUTO_FB_0;
   972		else if (fifo_ctl & FIFOCTL_AUTO_FB_1)
   973			byFBOption = AUTO_FB_1;
   974	
   975		if (!pvRrvTime)
   976			return;
   977	
   978		if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
   979			if (pvRTS) { /* RTS_need */
   980				/* Fill RsvTime */
   981				struct vnt_rrv_time_rts *buf = pvRrvTime;
   982	
   983				buf->rts_rrv_time_aa = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
   984								       wCurrentRate);
   985				buf->rts_rrv_time_ba = get_rtscts_time(pDevice, 1, byPktType, cbFrameSize,
   986								       wCurrentRate);
   987				buf->rts_rrv_time_bb = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
   988								       wCurrentRate);
   989				buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize,
   990									wCurrentRate, bNeedACK);
   991				buf->rrv_time_b =
   992					vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
   993							      pDevice->byTopCCKBasicRate, bNeedACK);
   994	
   995				s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
   996					       psEthHeader, wCurrentRate, byFBOption);
   997			} else {/* RTS_needless, PCF mode */
   998				struct vnt_rrv_time_cts *buf = pvRrvTime;
   999	
  1000				buf->rrv_time_a = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize,
  1001									wCurrentRate, bNeedACK);
  1002				buf->rrv_time_b =
  1003					vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
  1004							      pDevice->byTopCCKBasicRate, bNeedACK);
  1005				buf->cts_rrv_time_ba = get_rtscts_time(pDevice, 3, byPktType, cbFrameSize,
  1006								       wCurrentRate);
  1007	
  1008				/* Fill CTS */
  1009				s_vFillCTSHead(pDevice, uDMAIdx, byPktType, pvCTS, cbFrameSize, bNeedACK,
  1010					       bDisCRC, wCurrentRate, byFBOption);
  1011			}
  1012		} else if (byPktType == PK_TYPE_11A) {
  1013			if (pvRTS) {/* RTS_need, non PCF mode */
> 1014				struct vnt_rrv_time_ab *buf = pvRrvT
  1015					ime;
  1016	
  1017				buf->rts_rrv_time = get_rtscts_time(pDevice, 2, byPktType, cbFrameSize,
  1018								    wCurrentRate);
  1019				buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, byPktType, cbFrameSize,
  1020								      wCurrentRate, bNeedACK);
  1021	
  1022				/* Fill RTS */
  1023				s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
  1024					       psEthHeader, wCurrentRate, byFBOption);
  1025			} else if (!pvRTS) {/* RTS_needless, non PCF mode */
  1026				struct vnt_rrv_time_ab *buf = pvRrvTime;
  1027	
  1028				buf->rrv_time =
  1029					vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11A, cbFrameSize,
  1030							      wCurrentRate, bNeedACK);
  1031			}
  1032		} else if (byPktType == PK_TYPE_11B) {
  1033			if (pvRTS) {/* RTS_need, non PCF mode */
  1034				struct vnt_rrv_time_ab *buf = pvRrvTime;
  1035	
  1036				buf->rts_rrv_time = get_rtscts_time(pDevice, 0, byPktType, cbFrameSize,
  1037								    wCurrentRate);
  1038				buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
  1039								      wCurrentRate, bNeedACK);
  1040	
  1041				/* Fill RTS */
  1042				s_vFillRTSHead(pDevice, byPktType, pvRTS, cbFrameSize, bNeedACK, bDisCRC,
  1043					       psEthHeader, wCurrentRate, byFBOption);
  1044			} else { /* RTS_needless, non PCF mode */
  1045				struct vnt_rrv_time_ab *buf = pvRrvTime;
  1046	
  1047				buf->rrv_time = vnt_rxtx_rsvtime_le16(pDevice, PK_TYPE_11B, cbFrameSize,
  1048								      wCurrentRate, bNeedACK);
  1049			}
  1050		}
  1051	}
  1052
  
Praveen Kumar Oct. 21, 2022, 7:10 a.m. UTC | #3
On 20-10-2022 23:57, 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;
> +			struct vnt_rrv_time_ab *buf = pvRrvT
> +				ime;

I'm not sure if this patch is compiled ? In my understanding the recommendation is have the patch compiled and if possible basic sanity done (can discuss with respective maintainers if they can help / guide) before sending here. Please do the needful. Thanks.

>  
> -			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);
>  		}
>  	}
>  }

Regards,

~Praveen.
  
Julia Lawall Oct. 21, 2022, 7:16 a.m. UTC | #4
On Fri, 21 Oct 2022, Praveen Kumar wrote:

> On 20-10-2022 23:57, 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;
> > +			struct vnt_rrv_time_ab *buf = pvRrvT
> > +				ime;
>
> I'm not sure if this patch is compiled ? In my understanding the recommendation is have the patch compiled and if possible basic sanity done (can discuss with respective maintainers if they can help / guide) before sending here. Please do the needful. Thanks.

In particular, always be sure that you have a .o file for the .c file that
you changed.  The safest is to first try just compiling the file:

make path/to/my/file.o

Some files can't be compiled in that way.  You may need to do, eg

make path/to/my/

instead, but then there is a risk that even if you have compiled the
directory, you have not actually compled the file that you changed.  So
always check for the .o file.

julia


>
> >
> > -			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);
> >  		}
> >  	}
> >  }
>
> Regards,
>
> ~Praveen.
>
>
  
Tanjuate Brunostar Oct. 21, 2022, 7:21 a.m. UTC | #5
On Fri, Oct 21, 2022 at 8:16 AM Julia Lawall <julia.lawall@inria.fr> wrote:
>
>
>
> On Fri, 21 Oct 2022, Praveen Kumar wrote:
>
> > On 20-10-2022 23:57, 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;
> > > +                   struct vnt_rrv_time_ab *buf = pvRrvT
> > > +                           ime;
> >
> > I'm not sure if this patch is compiled ? In my understanding the recommendation is have the patch compiled and if possible basic sanity done (can discuss with respective maintainers if they can help / guide) before sending here. Please do the needful. Thanks.
>
> In particular, always be sure that you have a .o file for the .c file that
> you changed.  The safest is to first try just compiling the file:
>
> make path/to/my/file.o
>
> Some files can't be compiled in that way.  You may need to do, eg
>
> make path/to/my/
>
> instead, but then there is a risk that even if you have compiled the
> directory, you have not actually compled the file that you changed.  So
> always check for the .o file.
>
> julia
>
>
> >
> > >
> > > -                   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);
> > >             }
> > >     }
> > >  }
> >
> > Regards,
> >
> > ~Praveen.
> >
> >
Thanks for the guidance. Will do that
  

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);
 		}
 	}
 }