staging: vt6655: Fix CamelCase in upc.h and started in mac.h
cover staging: vt6655: Fix CamelCase in upc.h and started in mac.h
Start fix CamelCase by
- removing macros
- renaming macros
- converting from do-while(0) macro to function
---
Tested with vt6655 on mini PCI Module
Transferred this patch over vt6655
Philipp Hortmann (7):
staging: vt6655: Remove unused macros with do while(0)
staging: vt6655: Remove unused macros with CamelCase in mac.h
staging: vt6655: Rename constant definitions with CamelCase
staging: vt6655: Rename macro arguments with CamelCase
staging: vt6655: Rename macros VNSvInPortB,W,D
staging: vt6655: Rename macros VNSvOutPortB,W,D
staging: vt6655: Convert macro PCAvDelayByIO to function
drivers/staging/vt6655/baseband.c | 16 +- drivers/staging/vt6655/card.c | 60 +++--- drivers/staging/vt6655/channel.c | 4 +- drivers/staging/vt6655/device_main.c | 30 +-- drivers/staging/vt6655/mac.h | 293 ++++++++------------------- drivers/staging/vt6655/power.c | 4 +- drivers/staging/vt6655/rf.c | 14 +- drivers/staging/vt6655/rxtx.c | 4 +- drivers/staging/vt6655/srom.c | 29 ++- drivers/staging/vt6655/srom.h | 2 + drivers/staging/vt6655/upc.h | 47 ++--- 11 files changed, 186 insertions(+), 317 deletions(-)
Signature · 1 line
2.25.1
PATCH 1/7 staging: vt6655: Remove unused macros with do while(0)
Remove unused macros with do-while(0) loop in mac.h as they are not accepted by checkpatch.pl
--- drivers/staging/vt6655/mac.h | 85 ------------------------------------ 1 file changed, 85 deletions(-)
drivers/staging/vt6655/mac.h +0 -85
@@ -552,21 +552,6 @@ do { \VNSvOutPortW (iobase + byRegOfs, wData | (wBits)); \ } while (0) -#define MACvDWordRegBitsOn (iobase, byRegOfs, dwBits) \ -do { \ - unsigned long dwData; \ - VNSvInPortD(iobase + byRegOfs, &dwData); \ - VNSvOutPortD(iobase + byRegOfs, dwData | (dwBits)); \ -} while (0) - -#define MACvRegBitsOnEx (iobase, byRegOfs, byMask, byBits) \ -do { \ - unsigned char byData; \ - VNSvInPortB(iobase + byRegOfs, &byData); \ - byData &= byMask; \ - VNSvOutPortB(iobase + byRegOfs, byData | (byBits)); \ -} while (0) -#define MACvRegBitsOff (iobase, byRegOfs, byBits) \ do { \ unsigned char byData; \
@@ -581,13 +566,6 @@ do { \VNSvOutPortW (iobase + byRegOfs, wData & ~(wBits)); \ } while (0) -#define MACvDWordRegBitsOff (iobase, byRegOfs, dwBits) \ -do { \ - unsigned long dwData; \ - VNSvInPortD(iobase + byRegOfs, &dwData); \ - VNSvOutPortD(iobase + byRegOfs, dwData & ~(dwBits)); \ -} while (0) -#define MACvGetCurrRx0DescAddr (iobase, pdwCurrDescAddr) \ VNSvInPortD(iobase + MAC_REG_RXDMAPTR0, \ (unsigned long *)pdwCurrDescAddr)
@@ -622,24 +600,6 @@ do { \VNSvOutPortW (iobase +MAC_REG_BCNDMACTL +2 , \ wCurrBCNLength) -#define MACvReadBSSIDAddress (iobase, pbyEtherAddr) \ -do { \ - VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1); \ - VNSvInPortB(iobase + MAC_REG_BSSID0, \ - (unsigned char *)pbyEtherAddr); \ - VNSvInPortB(iobase + MAC_REG_BSSID0 + 1, \ - pbyEtherAddr + 1); \ - VNSvInPortB(iobase + MAC_REG_BSSID0 + 2, \ - pbyEtherAddr + 2); \ - VNSvInPortB(iobase + MAC_REG_BSSID0 + 3, \ - pbyEtherAddr + 3); \ - VNSvInPortB(iobase + MAC_REG_BSSID0 + 4, \ - pbyEtherAddr + 4); \ - VNSvInPortB(iobase + MAC_REG_BSSID0 + 5, \ - pbyEtherAddr + 5); \ - VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 0); \ -} while (0) -#define MACvWriteBSSIDAddress (iobase, pbyEtherAddr) \ do { \ VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1); \
@@ -676,24 +636,6 @@ do { \VNSvOutPortB (iobase +MAC_REG_PAGE1SEL ,0 ); \ } while (0) -#define MACvWriteEtherAddress (iobase, pbyEtherAddr) \ -do { \ - VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1); \ - VNSvOutPortB(iobase + MAC_REG_PAR0, \ - *pbyEtherAddr); \ - VNSvOutPortB(iobase + MAC_REG_PAR0 + 1, \ - *(pbyEtherAddr + 1)); \ - VNSvOutPortB(iobase + MAC_REG_PAR0 + 2, \ - *(pbyEtherAddr + 2)); \ - VNSvOutPortB(iobase + MAC_REG_PAR0 + 3, \ - *(pbyEtherAddr + 3)); \ - VNSvOutPortB(iobase + MAC_REG_PAR0 + 4, \ - *(pbyEtherAddr + 4)); \ - VNSvOutPortB(iobase + MAC_REG_PAR0 + 5, \ - *(pbyEtherAddr + 5)); \ - VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 0); \ -} while (0) -#define MACvClearISR (iobase) \ VNSvOutPortD(iobase + MAC_REG_ISR, IMR_MASK_VALUE)
@@ -759,26 +701,6 @@ do { \VNSvOutPortD (iobase +MAC_REG_AC0DMACTL ,DMACTL_RUN ); \ } while (0) -#define MACvTransmitSYNC (iobase) \ -do { \ - unsigned long dwData; \ - VNSvInPortD(iobase + MAC_REG_SYNCDMACTL, &dwData); \ - if (dwData & DMACTL_RUN) \ - VNSvOutPortD(iobase + MAC_REG_SYNCDMACTL, DMACTL_WAKE); \ - else \ - VNSvOutPortD(iobase + MAC_REG_SYNCDMACTL, DMACTL_RUN); \ -} while (0) - -#define MACvTransmitATIM (iobase) \ -do { \ - unsigned long dwData; \ - VNSvInPortD(iobase + MAC_REG_ATIMDMACTL, &dwData); \ - if (dwData & DMACTL_RUN) \ - VNSvOutPortD(iobase + MAC_REG_ATIMDMACTL, DMACTL_WAKE); \ - else \ - VNSvOutPortD(iobase + MAC_REG_ATIMDMACTL, DMACTL_RUN); \ -} while (0) -#define MACvTransmitBCN (iobase) \ VNSvOutPortB(iobase + MAC_REG_BCNDMACTL, BEACON_READY)
@@ -861,13 +783,6 @@ do { \#define MACvWriteATIMW (iobase, wCounter) \ VNSvOutPortW(iobase + MAC_REG_AIDATIM, wCounter) -#define MACvWriteCRC16_128 (iobase, byRegOfs, wCRC) \ -do { \ - VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1); \ - VNSvOutPortW(iobase + byRegOfs, wCRC); \ - VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 0); \ -} while (0) -#define MACvGPIOIn (iobase, pbyValue) \ VNSvInPortB(iobase + MAC_REG_GPIOCTL1, pbyValue)
Signature · 1 line
2.25.1
PATCH 2/7 staging: vt6655: Remove unused macros with CamelCase in mac.h
In reply to Philipp HortmannRemove unused macros with CamelCase variables in mac.h as they are not accepted by checkpatch.pl
--- drivers/staging/vt6655/mac.h | 48 ------------------------------------ 1 file changed, 48 deletions(-)
drivers/staging/vt6655/mac.h +0 -48
@@ -566,30 +566,6 @@ do { \VNSvOutPortW (iobase + byRegOfs, wData & ~(wBits)); \ }while (0 ) -#define MACvGetCurrRx0DescAddr (iobase, pdwCurrDescAddr) \ - VNSvInPortD(iobase + MAC_REG_RXDMAPTR0, \ - (unsigned long *)pdwCurrDescAddr) - -#define MACvGetCurrRx1DescAddr (iobase, pdwCurrDescAddr) \ - VNSvInPortD(iobase + MAC_REG_RXDMAPTR1, \ - (unsigned long *)pdwCurrDescAddr) - -#define MACvGetCurrTx0DescAddr (iobase, pdwCurrDescAddr) \ - VNSvInPortD(iobase + MAC_REG_TXDMAPTR0, \ - (unsigned long *)pdwCurrDescAddr) - -#define MACvGetCurrAC0DescAddr (iobase, pdwCurrDescAddr) \ - VNSvInPortD(iobase + MAC_REG_AC0DMAPTR, \ - (unsigned long *)pdwCurrDescAddr) - -#define MACvGetCurrSyncDescAddr (iobase, pdwCurrDescAddr) \ - VNSvInPortD(iobase + MAC_REG_SYNCDMAPTR, \ - (unsigned long *)pdwCurrDescAddr) - -#define MACvGetCurrATIMDescAddr (iobase, pdwCurrDescAddr) \ - VNSvInPortD(iobase + MAC_REG_ATIMDMAPTR, \ - (unsigned long *)pdwCurrDescAddr) - /* set the chip with current BCN tx descriptor address */#define MACvSetCurrBCNTxDescAddr (iobase, dwCurrDescAddr) \ VNSvOutPortD(iobase + MAC_REG_BCNDMAPTR, \
@@ -636,9 +612,6 @@ do { \VNSvOutPortB (iobase +MAC_REG_PAGE1SEL ,0 ); \ } while (0) -#define MACvClearISR (iobase) \ - VNSvOutPortD(iobase + MAC_REG_ISR, IMR_MASK_VALUE) -#define MACvStart (iobase) \ VNSvOutPortB(iobase + MAC_REG_HOSTCR, \ (HOSTCR_MACEN | HOSTCR_RXON | HOSTCR_TXON))
@@ -646,18 +619,9 @@ do { \#define MACvRx0PerPktMode (iobase) \ VNSvOutPortD(iobase + MAC_REG_RXDMACTL0, RX_PERPKT) -#define MACvRx0BufferFillMode (iobase) \ - VNSvOutPortD(iobase + MAC_REG_RXDMACTL0, RX_PERPKTCLR) -#define MACvRx1PerPktMode (iobase) \ VNSvOutPortD(iobase + MAC_REG_RXDMACTL1, RX_PERPKT) -#define MACvRx1BufferFillMode (iobase) \ - VNSvOutPortD(iobase + MAC_REG_RXDMACTL1, RX_PERPKTCLR) - -#define MACvRxOn (iobase) \ - MACvRegBitsOn(iobase, MAC_REG_HOSTCR, HOSTCR_RXON) -#define MACvReceive0 (iobase) \ do { \ unsigned long dwData; \
@@ -678,9 +642,6 @@ do { \VNSvOutPortD (iobase +MAC_REG_RXDMACTL1 ,DMACTL_RUN ); \ } while (0) -#define MACvTxOn (iobase) \ - MACvRegBitsOn(iobase, MAC_REG_HOSTCR, HOSTCR_TXON) -#define MACvTransmit0 (iobase) \ do { \ unsigned long dwData; \
@@ -733,9 +694,6 @@ do { \#define MACvReadMIBCounter (iobase, pdwCounter) \ VNSvInPortD(iobase + MAC_REG_MIBCNTR, pdwCounter) -#define MACvPwrEvntDisable (iobase) \ - VNSvOutPortW(iobase + MAC_REG_WAKEUPEN0, 0x0000) -#define MACvEnableProtectMD (iobase) \ do { \ unsigned long dwOrgValue; \
@@ -777,12 +735,6 @@ do { \VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ } while (0) -#define MACvReadATIMW (iobase, pwCounter) \ - VNSvInPortW(iobase + MAC_REG_AIDATIM, pwCounter) - -#define MACvWriteATIMW (iobase, wCounter) \ - VNSvOutPortW(iobase + MAC_REG_AIDATIM, wCounter) -#define MACvGPIOIn (iobase, pbyValue) \ VNSvInPortB(iobase + MAC_REG_GPIOCTL1, pbyValue)
Signature · 1 line
2.25.1
Re: [PATCH 2/7] staging: vt6655: Remove unused macros with CamelCase in mac.h
Hi Philipp,
Quoted 5 lines · Philipp Hortmann
Remove unused macros with CamelCase variables in
mac.has they are not accepted by checkpatch.plSigned-off-by Philipp Hortmann <[email protected]>---
You can merge 1/7 and 2/7, since you are just removing unused macros in same file.
With regards,
Pavel Skripkin
PATCH 3/7 staging: vt6655: Rename constant definitions with CamelCase
In reply to Philipp HortmannRename constant definitions with CamelCase in mac.h as they are not accepted by checkpatch.pl
--- drivers/staging/vt6655/mac.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
drivers/staging/vt6655/mac.h +18 -18
@@ -261,18 +261,18 @@#define TFTCTL_TSFCNTREN 0x01/* Bits in the EnhanceCFG register */ -#define EnCFG_BarkerPream 0x00020000 -#define EnCFG_NXTBTTCFPSTR 0x00010000 -#define EnCFG_BcnSusClr 0x00000200 -#define EnCFG_BcnSusInd 0x00000100 -#define EnCFG_CFP_ProtectEn 0x00000040 -#define EnCFG_ProtectMd 0x00000020 -#define EnCFG_HwParCFP 0x00000010 -#define EnCFG_CFNULRSP 0x00000004 -#define EnCFG_BBType_MASK 0x00000003 -#define EnCFG_BBType_g 0x00000002 -#define EnCFG_BBType_b 0x00000001 -#define EnCFG_BBType_a 0x00000000 +#define ENCFG_BARKERPREAM 0x00020000 +#define ENCFG_NXTBTTCFPSTR 0x00010000 +#define ENCFG_BCNSUSCLR 0x00000200 +#define ENCFG_BCNSUSIND 0x00000100 +#define ENCFG_CFP_PROTECTEN 0x00000040 +#define ENCFG_PROTECTMD 0x00000020 +#define ENCFG_HWPARCFP 0x00000010 +#define ENCFG_CFNULRSP 0x00000004 +#define ENCFG_BBTYPE_MASK 0x00000003 +#define ENCFG_BBTYPE_G 0x00000002 +#define ENCFG_BBTYPE_B 0x00000001 +#define ENCFG_BBTYPE_A 0x00000000/* Bits in the Page1Sel register */ #define PAGE1_SEL 0x01
@@ -497,7 +497,7 @@#define MAC_LB_INTERNAL 0x01#define MAC_LB_NONE 0x00 -#define Default_BI 0x200 +#define DEFAULT_BI 0x200/* MiscFIFO Offset */ #define MISCFIFO_KEYETRY0 32
@@ -698,7 +698,7 @@ do { \do { \unsigned long dwOrgValue; \VNSvInPortD (iobase +MAC_REG_ENCFG , &dwOrgValue); \ - dwOrgValue = dwOrgValue | EnCFG_ProtectMd; \ + dwOrgValue = dwOrgValue |ENCFG_PROTECTMD ; \VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ }while (0 )
@@ -706,7 +706,7 @@ do { \do { \unsigned long dwOrgValue; \VNSvInPortD (iobase +MAC_REG_ENCFG , &dwOrgValue); \ - dwOrgValue = dwOrgValue & ~EnCFG_ProtectMd; \ + dwOrgValue = dwOrgValue & ~ENCFG_PROTECTMD ; \VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ }while (0 )
@@ -714,7 +714,7 @@ do { \do { \unsigned long dwOrgValue; \VNSvInPortD (iobase +MAC_REG_ENCFG , &dwOrgValue); \ - dwOrgValue = dwOrgValue | EnCFG_BarkerPream; \ + dwOrgValue = dwOrgValue |ENCFG_BARKERPREAM ; \VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ }while (0 )
@@ -722,7 +722,7 @@ do { \do { \unsigned long dwOrgValue; \VNSvInPortD (iobase +MAC_REG_ENCFG , &dwOrgValue); \ - dwOrgValue = dwOrgValue & ~EnCFG_BarkerPream; \ + dwOrgValue = dwOrgValue & ~ENCFG_BARKERPREAM ; \VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ }while (0 )
@@ -730,7 +730,7 @@ do { \do { \unsigned long dwOrgValue; \VNSvInPortD (iobase +MAC_REG_ENCFG , &dwOrgValue); \ - dwOrgValue = dwOrgValue & ~EnCFG_BBType_MASK; \ + dwOrgValue = dwOrgValue & ~ENCFG_BBTYPE_MASK ; \ dwOrgValue = dwOrgValue | (unsigned long )byTyp; \VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ }while (0 )
Signature · 1 line
2.25.1
PATCH 4/7 staging: vt6655: Rename macro arguments with CamelCase
In reply to Philipp HortmannRename macro arguments with CamelCase in upc.h as they are not accepted by checkpatch.pl
Removed datatype in macro arguments.
Since there are more than one checkpatch issue per line, more steps are rquired to fix.
--- drivers/staging/vt6655/upc.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
drivers/staging/vt6655/upc.h +18 -18
@@ -20,34 +20,34 @@/* For memory mapped IO */ -#define VNSvInPortB (dwIOAddress, pbyData) \ - (*(pbyData) = ioread8(dwIOAddress)) +#define VNSvInPortB (io_address, data) \ + (*(data) = ioread8(io_address)) -#define VNSvInPortW (dwIOAddress, pwData) \ - (*(pwData) = ioread16(dwIOAddress)) +#define VNSvInPortW (io_address, data) \ + (*(data) = ioread16(io_address)) -#define VNSvInPortD (dwIOAddress, pdwData) \ - (*(pdwData) = ioread32(dwIOAddress)) +#define VNSvInPortD (io_address, data) \ + (*(data) = ioread32(io_address)) -#define VNSvOutPortB (dwIOAddress, byData) \ - iowrite8((u8)(byData), dwIOAddress) +#define VNSvOutPortB (io_address, data) \ + iowrite8((u8)(data), io_address) -#define VNSvOutPortW (dwIOAddress, wData) \ - iowrite16((u16)(wData), dwIOAddress) +#define VNSvOutPortW (io_address, data) \ + iowrite16((u16)(data), io_address) -#define VNSvOutPortD (dwIOAddress, dwData) \ - iowrite32((u32)(dwData), dwIOAddress) +#define VNSvOutPortD (io_address, data) \ + iowrite32((u32)(data), io_address) -#define PCAvDelayByIO (uDelayUnit) \ +#define PCAvDelayByIO (u_delay_unit) \ do { \ - unsigned char __maybe_unused byData; \ + unsigned char __maybe_unused data; \ unsigned long ii; \ \ - if (uDelayUnit <= 50) { \ - udelay(uDelayUnit); \ + if (u_delay_unit <= 50) { \ + udelay(u_delay_unit); \ } else { \ - for (ii = 0; ii < (uDelayUnit); ii++) \ - byData = inb(0x61); \ + for (ii = 0; ii < (u_delay_unit); ii++) \ + data = inb(0x61); \ } \ } while (0)
Signature · 1 line
2.25.1
PATCH 5/7 staging: vt6655: Rename macros VNSvInPortB,W,D
In reply to Philipp HortmannRename macros VNSvInPortB,W,D with CamelCase in upc.h as they are not accepted by checkpatch.pl
Since there are more than one checkpatch issue per line, more steps are rquired to fix.
--- drivers/staging/vt6655/baseband.c | 6 ++-- drivers/staging/vt6655/card.c | 6 ++-- drivers/staging/vt6655/device_main.c | 4 +-- drivers/staging/vt6655/mac.h | 46 ++++++++++++++-------------- drivers/staging/vt6655/rf.c | 2 +- drivers/staging/vt6655/srom.c | 6 ++-- drivers/staging/vt6655/upc.h | 6 ++-- 7 files changed, 38 insertions(+), 38 deletions(-)
drivers/staging/vt6655/baseband.c +3 -3
@@ -1916,13 +1916,13 @@ bool bb_read_embedded(struct vnt_private *priv, unsigned char by_bb_addr,MACvRegBitsOn (iobase,MAC_REG_BBREGCTL ,BBREGCTL_REGR );/* W_MAX_TIMEOUT is the timeout period */ for (ww =0 ; ww <W_MAX_TIMEOUT ; ww++) { -VNSvInPortB (iobase +MAC_REG_BBREGCTL , &by_value); +VNS_IN_PORTB (iobase +MAC_REG_BBREGCTL , &by_value);if (by_value &BBREGCTL_DONE )break ; }/* get BB data */ -VNSvInPortB (iobase +MAC_REG_BBREGDATA , pby_data); +VNS_IN_PORTB (iobase +MAC_REG_BBREGDATA , pby_data);if (ww ==W_MAX_TIMEOUT ) {pr_debug (" DBG_PORT80(0x30)\n" );
@@ -1961,7 +1961,7 @@ bool bb_write_embedded(struct vnt_private *priv, unsigned char by_bb_addr,MACvRegBitsOn (iobase,MAC_REG_BBREGCTL ,BBREGCTL_REGW );/* W_MAX_TIMEOUT is the timeout period */ for (ww =0 ; ww <W_MAX_TIMEOUT ; ww++) { -VNSvInPortB (iobase +MAC_REG_BBREGCTL , &by_value); +VNS_IN_PORTB (iobase +MAC_REG_BBREGCTL , &by_value);if (by_value &BBREGCTL_DONE )break ; }
drivers/staging/vt6655/card.c +3 -3
@@ -748,14 +748,14 @@ bool CARDbGetCurrentTSF(struct vnt_private *priv, u64 *pqwCurrTSF)MACvRegBitsOn (iobase,MAC_REG_TFTCTL ,TFTCTL_TSFCNTRRD );for (ww =0 ; ww <W_MAX_TIMEOUT ; ww++) { -VNSvInPortB (iobase +MAC_REG_TFTCTL , &data); +VNS_IN_PORTB (iobase +MAC_REG_TFTCTL , &data);if (!(data &TFTCTL_TSFCNTRRD ))break ; }if (ww ==W_MAX_TIMEOUT )return false; -VNSvInPortD (iobase +MAC_REG_TSFCNTR , (u32 *)pqwCurrTSF); -VNSvInPortD (iobase +MAC_REG_TSFCNTR +4 , (u32 *)pqwCurrTSF +1 ); +VNS_IN_PORTD (iobase +MAC_REG_TSFCNTR , (u32 *)pqwCurrTSF); +VNS_IN_PORTD (iobase +MAC_REG_TSFCNTR +4 , (u32 *)pqwCurrTSF +1 );return true; }
drivers/staging/vt6655/device_main.c +2 -2
@@ -219,7 +219,7 @@ static void device_init_registers(struct vnt_private *priv)MACvInitialize (priv);/* Get Local ID */ -VNSvInPortB (priv->port_offset +MAC_REG_LOCALID , &priv->local_id); +VNS_IN_PORTB (priv->port_offset +MAC_REG_LOCALID , &priv->local_id);spin_lock_irqsave (&priv->lock, flags);
@@ -1513,7 +1513,7 @@ static void vnt_configure(struct ieee80211_hw *hw, *total_flags &=FIF_ALLMULTI |FIF_OTHER_BSS |FIF_BCN_PRBRESP_PROMISC ; -VNSvInPortB (priv->port_offset +MAC_REG_RCR , &rx_mode); +VNS_IN_PORTB (priv->port_offset +MAC_REG_RCR , &rx_mode);dev_dbg (&priv->pcid->dev,"rx mode in = %x\n" , rx_mode);
drivers/staging/vt6655/mac.h +23 -23
156 lines not on this page · raw message
drivers/staging/vt6655/rf.c +1 -1
@@ -175,7 +175,7 @@ bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData)/* W_MAX_TIMEOUT is the timeout period */ for (ww =0 ; ww <W_MAX_TIMEOUT ; ww++) { -VNSvInPortD (iobase +MAC_REG_IFREGCTL , &dwValue); +VNS_IN_PORTD (iobase +MAC_REG_IFREGCTL , &dwValue);if (dwValue &IFREGCTL_DONE )break ; }
drivers/staging/vt6655/srom.c +3 -3
@@ -66,7 +66,7 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase,unsigned char byOrg; byData =0xFF ; -VNSvInPortB (iobase +MAC_REG_I2MCFG , &byOrg); +VNS_IN_PORTB (iobase +MAC_REG_I2MCFG , &byOrg);/* turn off hardware retry for getting NACK */ VNSvOutPortB (iobase +MAC_REG_I2MCFG , (byOrg & (~I2MCFG_NORETRY )));for (wNoACK =0 ; wNoACK <W_MAX_I2CRETRY ; wNoACK++) {
@@ -77,7 +77,7 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase,VNSvOutPortB (iobase +MAC_REG_I2MCSR ,I2MCSR_EEMR );/* wait DONE be set */ for (wDelay =0 ; wDelay <W_MAX_TIMEOUT ; wDelay++) { -VNSvInPortB (iobase +MAC_REG_I2MCSR , &byWait); +VNS_IN_PORTB (iobase +MAC_REG_I2MCSR , &byWait);if (byWait & (I2MCSR_DONE |I2MCSR_NACK ))break ;PCAvDelayByIO (CB_DELAY_LOOP_WAIT );
@@ -87,7 +87,7 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase,break ; } } -VNSvInPortB (iobase +MAC_REG_I2MDIPT , &byData); +VNS_IN_PORTB (iobase +MAC_REG_I2MDIPT , &byData);VNSvOutPortB (iobase +MAC_REG_I2MCFG , byOrg);return byData; }
drivers/staging/vt6655/upc.h +3 -3
@@ -20,13 +20,13 @@/* For memory mapped IO */ -#define VNSvInPortB (io_address, data) \ +#define VNS_IN_PORTB (io_address, data) \ (*(data) = ioread8(io_address)) -#define VNSvInPortW (io_address, data) \ +#define VNS_IN_PORTW (io_address, data) \ (*(data) = ioread16(io_address)) -#define VNSvInPortD (io_address, data) \ +#define VNS_IN_PORTD (io_address, data) \ (*(data) = ioread32(io_address))#define VNSvOutPortB (io_address, data) \
Signature · 1 line
2.25.1
PATCH 6/7 staging: vt6655: Rename macros VNSvOutPortB,W,D
In reply to Philipp HortmannRename macros VNSvOutPortB,W,D with CamelCase in upc.h as they are not accepted by checkpatch.pl
Since there are more than one checkpatch issue per line, more steps are rquired to fix.
--- drivers/staging/vt6655/baseband.c | 10 ++-- drivers/staging/vt6655/card.c | 54 +++++++++---------- drivers/staging/vt6655/channel.c | 4 +- drivers/staging/vt6655/device_main.c | 26 +++++----- drivers/staging/vt6655/mac.h | 78 ++++++++++++++-------------- drivers/staging/vt6655/power.c | 4 +- drivers/staging/vt6655/rf.c | 12 ++--- drivers/staging/vt6655/rxtx.c | 4 +- drivers/staging/vt6655/srom.c | 10 ++-- drivers/staging/vt6655/upc.h | 6 +-- 10 files changed, 104 insertions(+), 104 deletions(-)
drivers/staging/vt6655/baseband.c +5 -5
@@ -1910,7 +1910,7 @@ bool bb_read_embedded(struct vnt_private *priv, unsigned char by_bb_addr,unsigned char by_value;/* BB reg offset */ -VNSvOutPortB (iobase +MAC_REG_BBREGADR , by_bb_addr); +VNS_OUT_PORTB (iobase +MAC_REG_BBREGADR , by_bb_addr);/* turn on REGR */ MACvRegBitsOn (iobase,MAC_REG_BBREGCTL ,BBREGCTL_REGR );
@@ -1953,9 +1953,9 @@ bool bb_write_embedded(struct vnt_private *priv, unsigned char by_bb_addr,unsigned char by_value;/* BB reg offset */ -VNSvOutPortB (iobase +MAC_REG_BBREGADR , by_bb_addr); +VNS_OUT_PORTB (iobase +MAC_REG_BBREGADR , by_bb_addr);/* set BB data */ -VNSvOutPortB (iobase +MAC_REG_BBREGDATA , by_data); +VNS_OUT_PORTB (iobase +MAC_REG_BBREGDATA , by_data);/* turn on BBREGCTL_REGW */ MACvRegBitsOn (iobase,MAC_REG_BBREGCTL ,BBREGCTL_REGW );
@@ -2014,7 +2014,7 @@ bool bb_vt3253_init(struct vnt_private *priv) byVT3253B0_AGC4_RFMD2959[ii][0 ], byVT3253B0_AGC4_RFMD2959[ii][1]); -VNSvOutPortD (iobase +MAC_REG_ITRTMSET ,0x23 ); +VNS_OUT_PORTD (iobase +MAC_REG_ITRTMSET ,0x23 );MACvRegBitsOn (iobase,MAC_REG_PAPEDELAY ,BIT (0 )); } priv->abyBBVGA[0 ] =0x18 ;
@@ -2054,7 +2054,7 @@ bool bb_vt3253_init(struct vnt_private *priv) byVT3253B0_AGC[ii][0 ], byVT3253B0_AGC[ii][1]); -VNSvOutPortB (iobase +MAC_REG_ITRTMSET ,0x23 ); +VNS_OUT_PORTB (iobase +MAC_REG_ITRTMSET ,0x23 );MACvRegBitsOn (iobase,MAC_REG_PAPEDELAY ,BIT (0 )); priv->abyBBVGA[0 ] =0x14 ;
drivers/staging/vt6655/card.c +27 -27
179 lines not on this page · raw message
drivers/staging/vt6655/channel.c +2 -2
@@ -118,10 +118,10 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch)/* set HW default power register */ MACvSelectPage1 (priv->port_offset);RFbSetPower (priv,RATE_1M , priv->byCurrentCh); -VNSvOutPortB (priv->port_offset +MAC_REG_PWRCCK , +VNS_OUT_PORTB (priv->port_offset +MAC_REG_PWRCCK , priv->byCurPwr);RFbSetPower (priv,RATE_6M , priv->byCurrentCh); -VNSvOutPortB (priv->port_offset +MAC_REG_PWROFDM , +VNS_OUT_PORTB (priv->port_offset +MAC_REG_PWROFDM , priv->byCurPwr);MACvSelectPage0 (priv->port_offset);
drivers/staging/vt6655/device_main.c +13 -13
@@ -334,7 +334,7 @@ static void device_init_registers(struct vnt_private *priv)if (priv->local_id >REV_ID_VT3253_B1 ) {MACvSelectPage1 (priv->port_offset); -VNSvOutPortB (priv->port_offset +MAC_REG_MSRCTL +1 , +VNS_OUT_PORTB (priv->port_offset +MAC_REG_MSRCTL +1 , (MSRCTL1_TXPWR |MSRCTL1_CSAPAREN ));MACvSelectPage0 (priv->port_offset);
@@ -349,9 +349,9 @@ static void device_init_registers(struct vnt_private *priv)MACvSetLongRetryLimit (priv, priv->byLongRetryLimit);/* reset TSF counter */ -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTRST ); +VNS_OUT_PORTB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTRST );/* enable TSF counter */ -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTREN ); +VNS_OUT_PORTB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTREN );/* initialize BBP registers */ bb_vt3253_init (priv);
@@ -1060,8 +1060,8 @@ static void vnt_interrupt_process(struct vnt_private *priv)if (isr &ISR_FETALERR ) {pr_debug (" ISR_FETALERR\n" ); -VNSvOutPortB (priv->port_offset +MAC_REG_SOFTPWRCTL ,0 ); -VNSvOutPortW (priv->port_offset + +VNS_OUT_PORTB (priv->port_offset +MAC_REG_SOFTPWRCTL ,0 ); +VNS_OUT_PORTW (priv->port_offset +MAC_REG_SOFTPWRCTL ,SOFTPWRCTL_SWPECTI );device_error (priv, isr); }
@@ -1477,9 +1477,9 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,CARDvSetFirstNextTBTT (priv, conf->beacon_int); }else { -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL , +VNS_OUT_PORTB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTRST ); -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL , +VNS_OUT_PORTB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTREN ); } }
@@ -1526,18 +1526,18 @@ static void vnt_configure(struct ieee80211_hw *hw,if (priv->mc_list_count >2 ) {MACvSelectPage1 (priv->port_offset); -VNSvOutPortD (priv->port_offset + +VNS_OUT_PORTD (priv->port_offset +MAC_REG_MAR0 ,0xffffffff ); -VNSvOutPortD (priv->port_offset + +VNS_OUT_PORTD (priv->port_offset +MAC_REG_MAR0 +4 ,0xffffffff );MACvSelectPage0 (priv->port_offset); }else {MACvSelectPage1 (priv->port_offset); -VNSvOutPortD (priv->port_offset + +VNS_OUT_PORTD (priv->port_offset +MAC_REG_MAR0 , (u32 )multicast); -VNSvOutPortD (priv->port_offset + +VNS_OUT_PORTD (priv->port_offset +MAC_REG_MAR0 +4 , (u32)(multicast >>32 ));
@@ -1561,7 +1561,7 @@ static void vnt_configure(struct ieee80211_hw *hw, rx_mode |=RCR_BSSID ; } -VNSvOutPortB (priv->port_offset +MAC_REG_RCR , rx_mode); +VNS_OUT_PORTB (priv->port_offset +MAC_REG_RCR , rx_mode);dev_dbg (&priv->pcid->dev,"rx mode out= %x\n" , rx_mode); }
@@ -1621,7 +1621,7 @@ static void vnt_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)struct vnt_private *priv = hw->priv;/* reset TSF counter */ -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTRST ); +VNS_OUT_PORTB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTRST ); }static const struct ieee80211_ops vnt_mac_ops = {
drivers/staging/vt6655/mac.h +39 -39
219 lines not on this page · raw message
drivers/staging/vt6655/power.c +2 -2
@@ -52,10 +52,10 @@ void PSvEnablePowerSaving(struct vnt_private *priv,u16 wAID = priv->current_aid |BIT (14 ) |BIT (15 );/* set period of power up before TBTT */ -VNSvOutPortW (priv->port_offset +MAC_REG_PWBT ,C_PWBT ); +VNS_OUT_PORTW (priv->port_offset +MAC_REG_PWBT ,C_PWBT );if (priv->op_mode !=NL80211_IFTYPE_ADHOC ) {/* set AID */ -VNSvOutPortW (priv->port_offset +MAC_REG_AIDATIM , wAID); +VNS_OUT_PORTW (priv->port_offset +MAC_REG_AIDATIM , wAID); }/* Set AutoSleep */
drivers/staging/vt6655/rf.c +6 -6
@@ -171,7 +171,7 @@ bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData)unsigned short ww;unsigned long dwValue; -VNSvOutPortD (iobase +MAC_REG_IFREGCTL , dwData); +VNS_OUT_PORTD (iobase +MAC_REG_IFREGCTL , dwData);/* W_MAX_TIMEOUT is the timeout period */ for (ww =0 ; ww <W_MAX_TIMEOUT ; ww++) {
@@ -207,7 +207,7 @@ static bool RFbAL2230Init(struct vnt_private *priv) ret = true;/* 3-wire control for normal mode */ -VNSvOutPortB (iobase +MAC_REG_SOFTPWRCTL ,0 ); +VNS_OUT_PORTB (iobase +MAC_REG_SOFTPWRCTL ,0 );MACvWordRegBitsOn (iobase,MAC_REG_SOFTPWRCTL , (SOFTPWRCTL_SWPECTI |SOFTPWRCTL_TXPEINV ));
@@ -238,7 +238,7 @@ static bool RFbAL2230Init(struct vnt_private *priv) SOFTPWRCTL_TXPEINV));/* 3-wire control for power saving mode */ -VNSvOutPortB (iobase +MAC_REG_PSPWRSIG , (PSSIG_WPE3 |PSSIG_WPE2 ));/* 1100 0000 */ +VNS_OUT_PORTB (iobase +MAC_REG_PSPWRSIG , (PSSIG_WPE3 |PSSIG_WPE2 ));/* 1100 0000 */ return ret; }
@@ -254,10 +254,10 @@ static bool RFbAL2230SelectChannel(struct vnt_private *priv, unsigned char byCha ret &=IFRFbWriteEmbedded (priv, al2230_channel_table1[byChannel -1 ]);/* Set Channel[7] = 0 to tell H/W channel is changing now. */ -VNSvOutPortB (iobase +MAC_REG_CHANNEL , (byChannel &0x7F )); +VNS_OUT_PORTB (iobase +MAC_REG_CHANNEL , (byChannel &0x7F ));MACvTimer0MicroSDelay (priv,SWITCH_CHANNEL_DELAY_AL2230 );/* Set Channel[7] = 1 to tell H/W channel change is done. */ -VNSvOutPortB (iobase +MAC_REG_CHANNEL , (byChannel |0x80 )); +VNS_OUT_PORTB (iobase +MAC_REG_CHANNEL , (byChannel |0x80 ));return ret; }
@@ -350,7 +350,7 @@ bool rf_write_wake_prog_syn(struct vnt_private *priv, unsigned char rf_type,unsigned char sleep_count =0 ;unsigned short idx =MISCFIFO_SYNDATA_IDX ; -VNSvOutPortW (iobase +MAC_REG_MISCFFNDEX ,0 ); +VNS_OUT_PORTW (iobase +MAC_REG_MISCFFNDEX ,0 );switch (rf_type) {case RF_AIROHA :case RF_AL2230S :
drivers/staging/vt6655/rxtx.c +2 -2
@@ -1450,9 +1450,9 @@ int vnt_beacon_make(struct vnt_private *priv, struct ieee80211_vif *vif)int vnt_beacon_enable (struct vnt_private *priv,struct ieee80211_vif *vif,struct ieee80211_bss_conf *conf) { -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTRST ); +VNS_OUT_PORTB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTRST ); -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTREN ); +VNS_OUT_PORTB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTREN );CARDvSetFirstNextTBTT (priv, conf->beacon_int);
drivers/staging/vt6655/srom.c +5 -5
@@ -68,13 +68,13 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase, byData =0xFF ;VNS_IN_PORTB (iobase +MAC_REG_I2MCFG , &byOrg);/* turn off hardware retry for getting NACK */ -VNSvOutPortB (iobase +MAC_REG_I2MCFG , (byOrg & (~I2MCFG_NORETRY ))); +VNS_OUT_PORTB (iobase +MAC_REG_I2MCFG , (byOrg & (~I2MCFG_NORETRY )));for (wNoACK =0 ; wNoACK <W_MAX_I2CRETRY ; wNoACK++) { -VNSvOutPortB (iobase +MAC_REG_I2MTGID ,EEP_I2C_DEV_ID ); -VNSvOutPortB (iobase +MAC_REG_I2MTGAD , byContntOffset); +VNS_OUT_PORTB (iobase +MAC_REG_I2MTGID ,EEP_I2C_DEV_ID ); +VNS_OUT_PORTB (iobase +MAC_REG_I2MTGAD , byContntOffset);/* issue read command */ -VNSvOutPortB (iobase +MAC_REG_I2MCSR ,I2MCSR_EEMR ); +VNS_OUT_PORTB (iobase +MAC_REG_I2MCSR ,I2MCSR_EEMR );/* wait DONE be set */ for (wDelay =0 ; wDelay <W_MAX_TIMEOUT ; wDelay++) {VNS_IN_PORTB (iobase +MAC_REG_I2MCSR , &byWait);
@@ -88,7 +88,7 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase, } }VNS_IN_PORTB (iobase +MAC_REG_I2MDIPT , &byData); -VNSvOutPortB (iobase +MAC_REG_I2MCFG , byOrg); +VNS_OUT_PORTB (iobase +MAC_REG_I2MCFG , byOrg);return byData; }
drivers/staging/vt6655/upc.h +3 -3
@@ -29,13 +29,13 @@#define VNS_IN_PORTD (io_address, data) \ (*(data) = ioread32(io_address)) -#define VNSvOutPortB (io_address, data) \ +#define VNS_OUT_PORTB (io_address, data) \ iowrite8((u8)(data), io_address) -#define VNSvOutPortW (io_address, data) \ +#define VNS_OUT_PORTW (io_address, data) \ iowrite16((u16)(data), io_address) -#define VNSvOutPortD (io_address, data) \ +#define VNS_OUT_PORTD (io_address, data) \ iowrite32((u32)(data), io_address)#define PCAvDelayByIO (u_delay_unit) \
Signature · 1 line
2.25.1
PATCH 7/7 staging: vt6655: Convert macro PCAvDelayByIO to function
In reply to Philipp HortmannConvert do-while(0) macro PCAvDelayByIO to function and relocate.
--- drivers/staging/vt6655/srom.c | 13 +++++++++++++ drivers/staging/vt6655/srom.h | 2 ++ drivers/staging/vt6655/upc.h | 13 ------------- 3 files changed, 15 insertions(+), 13 deletions(-)
drivers/staging/vt6655/srom.c +13 -0
@@ -139,3 +139,16 @@ void SROMvReadEtherAddress(void __iomem *iobase, pbyEtherAddress++; } } + +void PCAvDelayByIO (unsigned char u_delay_unit) +{ +unsigned char data; +unsigned long ii; + +if (u_delay_unit <=50 ) { +udelay (u_delay_unit); + }else { +for (ii =0 ; ii < (u_delay_unit); ii++) + data =inb (0x61 ); + } +}
drivers/staging/vt6655/srom.h +2 -0
@@ -82,4 +82,6 @@ void SROMvReadAllContents(void __iomem *iobase, unsigned char *pbyEepromRegs);void SROMvReadEtherAddress (void __iomem *iobase,unsigned char *pbyEtherAddress); +void PCAvDelayByIO (unsigned char u_delay_unit); +#endif /* __EEPROM_H__*/
drivers/staging/vt6655/upc.h +0 -13
@@ -38,19 +38,6 @@#define VNS_OUT_PORTD (io_address, data) \ iowrite32((u32)(data), io_address) -#define PCAvDelayByIO (u_delay_unit) \ -do { \ - unsigned char __maybe_unused data; \ - unsigned long ii; \ - \ - if (u_delay_unit <= 50) { \ - udelay(u_delay_unit); \ - } else { \ - for (ii = 0; ii < (u_delay_unit); ii++) \ - data = inb(0x61); \ - } \ -} while (0) -/*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/
Signature · 1 line
2.25.1
kernel test robot
build botRe: [PATCH 7/7] staging: vt6655: Convert macro PCAvDelayByIO to function
Thank you for the patch! Perhaps something to improve:
Hi Philipp,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Philipp-Hortmann/staging-vt6655-Fix-CamelCase-in-upc-h-and-started-in-mac-h/20220402-153118 base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git b22c721c4f3fd4608da059c56fbe7a0cc598fb6a config: parisc-buildonly-randconfig-r006-20220402 (https://download.01.org/0day-ci/archive/20220402/[email protected]/config) compiler: hppa-linux-gcc (GCC) 11.2.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/87b8c1713c4ec7a743b07417150821e2c83dd49d
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Philipp-Hortmann/staging-vt6655-Fix-CamelCase-in-upc-h-and-started-in-mac-h/20220402-153118 git checkout 87b8c1713c4ec7a743b07417150821e2c83dd49d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc SHELL=/bin/bash drivers/staging/vt6655/
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
drivers/staging/vt6655/srom.c: In function 'PCAvDelayByIO':
>> drivers/staging/vt6655/srom.c:145:23: warning: variable 'data' set but not used [-Wunused-but-set-variable]
145 | unsigned char data;
| ^~~~vim +/data +145 drivers/staging/vt6655/srom.c
142
143 void PCAvDelayByIO(unsigned char u_delay_unit)
144 {
> 145 unsigned char data;
Signature · 2 lines
0-DAY CI Kernel Test Service https://01.org/lkp
Greg Kroah-Hartman
maintainerRe: [PATCH 7/7] staging: vt6655: Convert macro PCAvDelayByIO to function
In reply to Philipp HortmannQuoted 1 line · Philipp Hortmann
Convert do-while(0) macro PCAvDelayByIO to function and relocate.
That says what you did, but not _why_ you did it.
Please read the kernel documentation again for how to write a good changelog comment and resend a v2.
thanks,
greg k-h