staging: vt6655: Fix CamelCase in upc.h and started in mac.h
v3 cover staging: vt6655: Fix CamelCase in upc.h and started in mac.h
Start fix CamelCase or do-while{0} issues in macros by
- replacing macros with command used in macros
as CamelCase or do-while{0} are not accepted by checkpatch.pl
---
V1 -> V2: Merged first two patches into one.
Patch 6/6: changed from (macro to function) to delete macro Updated cover-letter description
V2 -> V3: Removed first two patches as they were accepted.
Replaced macros with command used in macros. Replaced only one macro per patch
Updated cover-letter description
Tested with vt6655 on mini PCI Module
Transferred this patch over vt6655
Philipp Hortmann (7):
staging: vt6655: Replace VNSvInPortB with ioread8
staging: vt6655: Replace VNSvInPortW with ioread16
staging: vt6655: Replace VNSvInPortD with ioread32
staging: vt6655: Replace VNSvOutPortB with iowrite8
staging: vt6655: Replace VNSvOutPortW with iowrite16
staging: vt6655: Replace VNSvOutPortD with iowrite32
staging: vt6655: Remove macro PCAvDelayByIO
drivers/staging/vt6655/baseband.c | 16 +-- drivers/staging/vt6655/card.c | 73 ++++++-------- drivers/staging/vt6655/channel.c | 6 +- drivers/staging/vt6655/device_main.c | 40 +++----- drivers/staging/vt6655/mac.h | 139 ++++++++++++--------------- drivers/staging/vt6655/power.c | 4 +- drivers/staging/vt6655/rf.c | 14 +-- drivers/staging/vt6655/rxtx.c | 4 +- drivers/staging/vt6655/srom.c | 18 ++-- drivers/staging/vt6655/upc.h | 31 ------ 10 files changed, 138 insertions(+), 207 deletions(-)
Signature · 1 line
2.25.1
PATCH v3 1/7 staging: vt6655: Replace VNSvInPortB with ioread8
Replace macro VNSvInPortB with ioread8.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.pl
Since there are more than one checkpatch issue per line, more steps are rquired to fix.
---
V1 -> V2: This patch was 4/7 and is now 3/6
V2 -> V3: Changed from rename macro arguments to replace
macro VNSvInPortB with ioread8
This patch was 3/6 and is now 1/7
--- drivers/staging/vt6655/baseband.c | 6 +++--- drivers/staging/vt6655/card.c | 2 +- drivers/staging/vt6655/device_main.c | 4 ++-- drivers/staging/vt6655/mac.h | 26 ++++++++++---------------- drivers/staging/vt6655/srom.c | 6 +++--- drivers/staging/vt6655/upc.h | 3 --- 6 files changed, 19 insertions(+), 28 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); + by_value =ioread8 (iobase +MAC_REG_BBREGCTL );if (by_value &BBREGCTL_DONE )break ; }/* get BB data */ -VNSvInPortB (iobase +MAC_REG_BBREGDATA , pby_data); + *pby_data =ioread8 (iobase +MAC_REG_BBREGDATA );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); + by_value =ioread8 (iobase +MAC_REG_BBREGCTL );if (by_value &BBREGCTL_DONE )break ; }
drivers/staging/vt6655/card.c +1 -1
@@ -748,7 +748,7 @@ 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); + data =ioread8 (iobase +MAC_REG_TFTCTL );if (!(data &TFTCTL_TSFCNTRRD ))break ; }
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); + priv->local_id =ioread8 (priv->port_offset +MAC_REG_LOCALID );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); + rx_mode =ioread8 (priv->port_offset +MAC_REG_RCR );dev_dbg (&priv->pcid->dev,"rx mode in = %x\n" , rx_mode);
drivers/staging/vt6655/mac.h +10 -16
@@ -541,7 +541,7 @@#define MACvRegBitsOn (iobase, byRegOfs, byBits) \ do { \ unsigned char byData; \ - VNSvInPortB(iobase + byRegOfs, &byData); \ + byData = ioread8(iobase + byRegOfs); \ VNSvOutPortB(iobase + byRegOfs, byData | (byBits)); \ } while (0)
@@ -555,7 +555,7 @@ do { \#define MACvRegBitsOff (iobase, byRegOfs, byBits) \ do { \ unsigned char byData; \ - VNSvInPortB(iobase + byRegOfs, &byData); \ + byData = ioread8(iobase + byRegOfs); \ VNSvOutPortB(iobase + byRegOfs, byData & ~(byBits)); \ } while (0)
@@ -597,18 +597,12 @@ do { \#define MACvReadEtherAddress (iobase, pbyEtherAddr) \ do { \ VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1); \ - VNSvInPortB(iobase + MAC_REG_PAR0, \ - (unsigned char *)pbyEtherAddr); \ - VNSvInPortB(iobase + MAC_REG_PAR0 + 1, \ - pbyEtherAddr + 1); \ - VNSvInPortB(iobase + MAC_REG_PAR0 + 2, \ - pbyEtherAddr + 2); \ - VNSvInPortB(iobase + MAC_REG_PAR0 + 3, \ - pbyEtherAddr + 3); \ - VNSvInPortB(iobase + MAC_REG_PAR0 + 4, \ - pbyEtherAddr + 4); \ - VNSvInPortB(iobase + MAC_REG_PAR0 + 5, \ - pbyEtherAddr + 5); \ + (*((unsigned char *)pbyEtherAddr) = ioread8(iobase + MAC_REG_PAR0)); \ + (*(pbyEtherAddr + 1) = ioread8(iobase + MAC_REG_PAR0 + 1)); \ + (*(pbyEtherAddr + 2) = ioread8(iobase + MAC_REG_PAR0 + 2)); \ + (*(pbyEtherAddr + 3) = ioread8(iobase + MAC_REG_PAR0 + 3)); \ + (*(pbyEtherAddr + 4) = ioread8(iobase + MAC_REG_PAR0 + 4)); \ + (*(pbyEtherAddr + 5) = ioread8(iobase + MAC_REG_PAR0 + 5)); \ VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 0); \ } while (0)
@@ -668,7 +662,7 @@ do { \#define MACvClearStckDS (iobase) \ do { \ unsigned char byOrgValue; \ - VNSvInPortB(iobase + MAC_REG_STICKHW, &byOrgValue); \ + byOrgValue = ioread8(iobase + MAC_REG_STICKHW); \ byOrgValue = byOrgValue & 0xFC; \ VNSvOutPortB(iobase + MAC_REG_STICKHW, byOrgValue); \ } while (0)
@@ -736,7 +730,7 @@ do { \ } while (0)#define MACvGPIOIn (iobase, pbyValue) \ - VNSvInPortB(iobase + MAC_REG_GPIOCTL1, pbyValue) + *(pbyValue) = ioread8(iobase + MAC_REG_GPIOCTL1)#define MACvSetRFLE_LatchBase (iobase) \ MACvWordRegBitsOn(iobase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_RFLEOPT)
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); + byOrg =ioread8 (iobase +MAC_REG_I2MCFG );/* 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); + byWait =ioread8 (iobase +MAC_REG_I2MCSR );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); + byData =ioread8 (iobase +MAC_REG_I2MDIPT );VNSvOutPortB (iobase +MAC_REG_I2MCFG , byOrg);return byData; }
drivers/staging/vt6655/upc.h +0 -3
@@ -20,9 +20,6 @@/* For memory mapped IO */ -#define VNSvInPortB (dwIOAddress, pbyData) \ - (*(pbyData) = ioread8(dwIOAddress)) -#define VNSvInPortW (dwIOAddress, pwData) \ (*(pwData) = ioread16(dwIOAddress))
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerRe: [PATCH v3 1/7] staging: vt6655: Replace VNSvInPortB with ioread8
Quoted 27 lines · Philipp Hortmann
Replace macro VNSvInPortB with ioread8.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.plSince there are more than one checkpatch issue per line, more steps are rquired to fix.
Signed-off-by Philipp Hortmann <[email protected]>---
V1 -> V2: This patch was 4/7 and is now 3/6
V2 -> V3: Changed from rename macro arguments to replace
macro VNSvInPortB with ioread8
This patch was 3/6 and is now 1/7--- drivers/staging/vt6655/baseband.c | 6 +++--- drivers/staging/vt6655/card.c | 2 +- drivers/staging/vt6655/device_main.c | 4 ++-- drivers/staging/vt6655/mac.h | 26 ++++++++++---------------- drivers/staging/vt6655/srom.c | 6 +++--- drivers/staging/vt6655/upc.h | 3 --- 6 files changed, 19 insertions(+), 28 deletions(-)drivers/staging/vt6655/baseband.c +0
-0
drivers/staging/vt6655/baseband.c bool bb_read_embedded(struct vnt_private *priv, unsigned char by_bb_addr, · line 1919
Quoted 5 lines
drivers/staging/vt6655/baseband.c +1
-1@@ -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); + by_value =ioread8 (iobase +MAC_REG_BBREGCTL );
This type of change is great, but...
Quoted 7 lines
drivers/staging/vt6655/baseband.c +0
-3@@ -597,18 +597,12 @@ do { \#define MACvReadEtherAddress (iobase, pbyEtherAddr) \ do { \ VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1); \ - VNSvInPortB(iobase + MAC_REG_PAR0, \ - (unsigned char *)pbyEtherAddr); \ - VNSvInPortB(iobase + MAC_REG_PAR0 + 1, \
drivers/staging/vt6655/baseband.c do { \ · line 600
Quoted 10 lines
drivers/staging/vt6655/baseband.c +1
-9- pbyEtherAddr + 1); \ -VNSvInPortB (iobase +MAC_REG_PAR0 +2 , \ - pbyEtherAddr +2 ); \ -VNSvInPortB (iobase +MAC_REG_PAR0 +3 , \ - pbyEtherAddr +3 ); \ -VNSvInPortB (iobase +MAC_REG_PAR0 +4 , \ - pbyEtherAddr +4 ); \ -VNSvInPortB (iobase +MAC_REG_PAR0 +5 , \ - pbyEtherAddr +5 ); \ + (*((unsigned char *)pbyEtherAddr) =ioread8 (iobase +MAC_REG_PAR0 )); \
Why cast one and not all? No casts should be needed. If so, the caller is wrong.
drivers/staging/vt6655/baseband.c do { \ · line 601
Quoted 1 line
drivers/staging/vt6655/baseband.c +1
-0+ (*(pbyEtherAddr +1 ) =ioread8 (iobase +MAC_REG_PAR0 +1 )); \
That's odd.
Ok, I guess it's an array, right? How about:
pbyEtherAddr[0] = ioread8(iobase + MAC_REG_PAR0); \ pbyEtherAddr[1] = ioread8(iobase + MAC_REG_PAR0 + 1); \
and so on?
Much simpler and easier to understand.
And then there's this odd stuff:
drivers/staging/vt6655/baseband.c do { \ · line 603
Quoted 3 lines
drivers/staging/vt6655/baseband.c +1
-1#define MACvGPIOIn (iobase, pbyValue) \ - VNSvInPortB(iobase + MAC_REG_GPIOCTL1, pbyValue) + *(pbyValue) = ioread8(iobase + MAC_REG_GPIOCTL1)
pbyValue? unwind this first, you should be able to just have a normal ioread() call, right?
Or, make it a function.
thanks,
greg k-h
PATCH v3 2/7 staging: vt6655: Replace VNSvInPortW with ioread16
In reply to Philipp HortmannReplace macro VNSvInPortW with ioread16.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.pl
Since there are more than one checkpatch issue per line, more steps are rquired to fix.
---
V1 -> V2: This patch was 5/7 and is now 4/6
V2 -> V3: Changed from
"Rename macros VNSvInPortB,W,D with CamelCase ..." to Replace VNSvInPortW with ioread16
This patch was 4/6 and is now 2/7
--- drivers/staging/vt6655/mac.h | 4 ++-- drivers/staging/vt6655/upc.h | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/staging/vt6655/mac.h +2 -2
@@ -548,7 +548,7 @@ do { \#define MACvWordRegBitsOn (iobase, byRegOfs, wBits) \ do { \ unsigned short wData; \ - VNSvInPortW(iobase + byRegOfs, &wData); \ + wData = ioread16(iobase + byRegOfs); \ VNSvOutPortW(iobase + byRegOfs, wData | (wBits)); \ } while (0)
@@ -562,7 +562,7 @@ do { \#define MACvWordRegBitsOff (iobase, byRegOfs, wBits) \ do { \ unsigned short wData; \ - VNSvInPortW(iobase + byRegOfs, &wData); \ + wData = ioread16(iobase + byRegOfs); \ VNSvOutPortW(iobase + byRegOfs, wData & ~(wBits)); \ } while (0)
drivers/staging/vt6655/upc.h +0 -3
@@ -20,9 +20,6 @@/* For memory mapped IO */ -#define VNSvInPortW (dwIOAddress, pwData) \ - (*(pwData) = ioread16(dwIOAddress)) -#define VNSvInPortD (dwIOAddress, pdwData) \ (*(pdwData) = ioread32(dwIOAddress))
Signature · 1 line
2.25.1
PATCH v3 3/7 staging: vt6655: Replace VNSvInPortD with ioread32
In reply to Philipp HortmannReplace macro VNSvInPortD with ioread32.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.pl
Since there are more than one checkpatch issue per line, more steps are rquired to fix.
---
V1 -> V2: This patch was 5/7 and is now 4/6
V2 -> V3: Inserted patch that was before in a different way in
"Rename macros VNSvInPortB,W,D with CamelCase ..." This patch was part of 4/6 and is now 3/7
--- drivers/staging/vt6655/card.c | 4 ++-- drivers/staging/vt6655/mac.h | 22 +++++++++++----------- drivers/staging/vt6655/rf.c | 2 +- drivers/staging/vt6655/upc.h | 3 --- 4 files changed, 14 insertions(+), 17 deletions(-)
drivers/staging/vt6655/card.c +2 -2
@@ -754,8 +754,8 @@ bool CARDbGetCurrentTSF(struct vnt_private *priv, u64 *pqwCurrTSF) }if (ww ==W_MAX_TIMEOUT )return false; -VNSvInPortD (iobase +MAC_REG_TSFCNTR , (u32 *)pqwCurrTSF); -VNSvInPortD (iobase +MAC_REG_TSFCNTR +4 , (u32 *)pqwCurrTSF +1 ); + *((u32 *)pqwCurrTSF) =ioread32 (iobase +MAC_REG_TSFCNTR ); + *((u32 *)pqwCurrTSF +1 ) =ioread32 (iobase +MAC_REG_TSFCNTR +4 );return true; }
drivers/staging/vt6655/mac.h +11 -11
@@ -619,7 +619,7 @@ do { \#define MACvReceive0 (iobase) \ do { \ unsigned long dwData; \ - VNSvInPortD(iobase + MAC_REG_RXDMACTL0, &dwData); \ + dwData = ioread32(iobase + MAC_REG_RXDMACTL0); \ if (dwData & DMACTL_RUN) \ VNSvOutPortD(iobase + MAC_REG_RXDMACTL0, DMACTL_WAKE); \ else \
@@ -629,7 +629,7 @@ do { \#define MACvReceive1 (iobase) \ do { \ unsigned long dwData; \ - VNSvInPortD(iobase + MAC_REG_RXDMACTL1, &dwData); \ + dwData = ioread32(iobase + MAC_REG_RXDMACTL1); \ if (dwData & DMACTL_RUN) \ VNSvOutPortD(iobase + MAC_REG_RXDMACTL1, DMACTL_WAKE); \ else \
@@ -639,7 +639,7 @@ do { \#define MACvTransmit0 (iobase) \ do { \ unsigned long dwData; \ - VNSvInPortD(iobase + MAC_REG_TXDMACTL0, &dwData); \ + dwData = ioread32(iobase + MAC_REG_TXDMACTL0); \ if (dwData & DMACTL_RUN) \ VNSvOutPortD(iobase + MAC_REG_TXDMACTL0, DMACTL_WAKE); \ else \
@@ -649,7 +649,7 @@ do { \#define MACvTransmitAC0 (iobase) \ do { \ unsigned long dwData; \ - VNSvInPortD(iobase + MAC_REG_AC0DMACTL, &dwData); \ + dwData = ioread32(iobase + MAC_REG_AC0DMACTL); \ if (dwData & DMACTL_RUN) \ VNSvOutPortD(iobase + MAC_REG_AC0DMACTL, DMACTL_WAKE); \ else \
@@ -668,7 +668,7 @@ do { \ } while (0)#define MACvReadISR (iobase, pdwValue) \ - VNSvInPortD(iobase + MAC_REG_ISR, pdwValue) + *(pdwValue) = ioread32(iobase + MAC_REG_ISR)#define MACvWriteISR (iobase, dwValue) \ VNSvOutPortD(iobase + MAC_REG_ISR, dwValue)
@@ -686,12 +686,12 @@ do { \ VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1)#define MACvReadMIBCounter (iobase, pdwCounter) \ - VNSvInPortD(iobase + MAC_REG_MIBCNTR, pdwCounter) + *(pdwCounter) = ioread32(iobase + MAC_REG_MIBCNTR)#define MACvEnableProtectMD (iobase) \ do { \ unsigned long dwOrgValue; \ - VNSvInPortD(iobase + MAC_REG_ENCFG, &dwOrgValue); \ + dwOrgValue = ioread32(iobase + MAC_REG_ENCFG); \ dwOrgValue = dwOrgValue | ENCFG_PROTECTMD; \ VNSvOutPortD(iobase + MAC_REG_ENCFG, dwOrgValue); \ } while (0)
@@ -699,7 +699,7 @@ do { \#define MACvDisableProtectMD (iobase) \ do { \ unsigned long dwOrgValue; \ - VNSvInPortD(iobase + MAC_REG_ENCFG, &dwOrgValue); \ + dwOrgValue = ioread32(iobase + MAC_REG_ENCFG); \ dwOrgValue = dwOrgValue & ~ENCFG_PROTECTMD; \ VNSvOutPortD(iobase + MAC_REG_ENCFG, dwOrgValue); \ } while (0)
@@ -707,7 +707,7 @@ do { \#define MACvEnableBarkerPreambleMd (iobase) \ do { \ unsigned long dwOrgValue; \ - VNSvInPortD(iobase + MAC_REG_ENCFG, &dwOrgValue); \ + dwOrgValue = ioread32(iobase + MAC_REG_ENCFG); \ dwOrgValue = dwOrgValue | ENCFG_BARKERPREAM; \ VNSvOutPortD(iobase + MAC_REG_ENCFG, dwOrgValue); \ } while (0)
@@ -715,7 +715,7 @@ do { \#define MACvDisableBarkerPreambleMd (iobase) \ do { \ unsigned long dwOrgValue; \ - VNSvInPortD(iobase + MAC_REG_ENCFG, &dwOrgValue); \ + dwOrgValue = ioread32(iobase + MAC_REG_ENCFG); \ dwOrgValue = dwOrgValue & ~ENCFG_BARKERPREAM; \ VNSvOutPortD(iobase + MAC_REG_ENCFG, dwOrgValue); \ } while (0)
@@ -723,7 +723,7 @@ do { \#define MACvSetBBType (iobase, byTyp) \ do { \ unsigned long dwOrgValue; \ - VNSvInPortD(iobase + MAC_REG_ENCFG, &dwOrgValue); \ + dwOrgValue = ioread32(iobase + MAC_REG_ENCFG); \ dwOrgValue = dwOrgValue & ~ENCFG_BBTYPE_MASK; \ dwOrgValue = dwOrgValue | (unsigned long)byTyp; \ VNSvOutPortD(iobase + MAC_REG_ENCFG, dwOrgValue); \
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); + dwValue =ioread32 (iobase +MAC_REG_IFREGCTL );if (dwValue &IFREGCTL_DONE )break ; }
drivers/staging/vt6655/upc.h +0 -3
@@ -20,9 +20,6 @@/* For memory mapped IO */ -#define VNSvInPortD (dwIOAddress, pdwData) \ - (*(pdwData) = ioread32(dwIOAddress)) -#define VNSvOutPortB (dwIOAddress, byData) \ iowrite8((u8)(byData), dwIOAddress)
Signature · 1 line
2.25.1
PATCH v3 4/7 staging: vt6655: Replace VNSvOutPortB with iowrite8
In reply to Philipp HortmannReplace macro VNSvOutPortB with iowrite8.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.pl
For constants from 0 to below 0x80 the u8 cast was omitted. For variables which are defined as unsigned char the u8 is omitted.
Since there are more than one checkpatch issue per line, more steps are rquired to fix.
---
V1 -> V2: This patch was 6/7 and is now 5/6 V2 -> V3: Changed from
"Rename macros VNSvOutPortB,W,D" to Replace VNSvOutPortB with iowrite8 This patch was part of 5/6 and is now 4/7
--- drivers/staging/vt6655/baseband.c | 8 +++--- drivers/staging/vt6655/card.c | 11 ++++---- drivers/staging/vt6655/channel.c | 6 ++-- drivers/staging/vt6655/device_main.c | 19 ++++++------- drivers/staging/vt6655/mac.h | 41 ++++++++++++---------------- drivers/staging/vt6655/rf.c | 8 +++--- drivers/staging/vt6655/rxtx.c | 4 +-- drivers/staging/vt6655/srom.c | 10 +++---- drivers/staging/vt6655/upc.h | 3 -- 9 files changed, 47 insertions(+), 63 deletions(-)
drivers/staging/vt6655/baseband.c +4 -4
@@ -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); +iowrite8 (by_bb_addr, iobase +MAC_REG_BBREGADR );/* 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); +iowrite8 (by_bb_addr, iobase +MAC_REG_BBREGADR );/* set BB data */ -VNSvOutPortB (iobase +MAC_REG_BBREGDATA , by_data); +iowrite8 (by_data, iobase +MAC_REG_BBREGDATA );/* turn on BBREGCTL_REGW */ MACvRegBitsOn (iobase,MAC_REG_BBREGCTL ,BBREGCTL_REGW );
@@ -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 ); +iowrite8 (0x23 , iobase +MAC_REG_ITRTMSET );MACvRegBitsOn (iobase,MAC_REG_PAPEDELAY ,BIT (0 )); priv->abyBBVGA[0 ] =0x14 ;
drivers/staging/vt6655/card.c +5 -6
@@ -239,26 +239,25 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)if (priv->bySIFS != bySIFS) { priv->bySIFS = bySIFS; -VNSvOutPortB (priv->port_offset +MAC_REG_SIFS , priv->bySIFS); +iowrite8 (priv->bySIFS, priv->port_offset +MAC_REG_SIFS ); }if (priv->byDIFS != byDIFS) { priv->byDIFS = byDIFS; -VNSvOutPortB (priv->port_offset +MAC_REG_DIFS , priv->byDIFS); +iowrite8 (priv->byDIFS, priv->port_offset +MAC_REG_DIFS ); }if (priv->byEIFS !=C_EIFS ) { priv->byEIFS =C_EIFS ; -VNSvOutPortB (priv->port_offset +MAC_REG_EIFS , priv->byEIFS); +iowrite8 (priv->byEIFS, priv->port_offset +MAC_REG_EIFS ); }if (priv->bySlot != bySlot) { priv->bySlot = bySlot; -VNSvOutPortB (priv->port_offset +MAC_REG_SLOT , priv->bySlot); +iowrite8 (priv->bySlot, priv->port_offset +MAC_REG_SLOT );bb_set_short_slot_time (priv); }if (priv->byCWMaxMin != byCWMaxMin) { priv->byCWMaxMin = byCWMaxMin; -VNSvOutPortB (priv->port_offset +MAC_REG_CWMAXMIN0 , - priv->byCWMaxMin); +iowrite8 (priv->byCWMaxMin, priv->port_offset +MAC_REG_CWMAXMIN0 ); } priv->byPacketType =CARDbyGetPktType (priv);
drivers/staging/vt6655/channel.c +2 -4
@@ -118,11 +118,9 @@ 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 , - priv->byCurPwr); +iowrite8 (priv->byCurPwr, priv->port_offset +MAC_REG_PWRCCK );RFbSetPower (priv,RATE_6M , priv->byCurrentCh); -VNSvOutPortB (priv->port_offset +MAC_REG_PWROFDM , - priv->byCurPwr); +iowrite8 (priv->byCurPwr, priv->port_offset +MAC_REG_PWROFDM );MACvSelectPage0 (priv->port_offset);spin_unlock_irqrestore (&priv->lock, flags);
drivers/staging/vt6655/device_main.c +8 -11
@@ -334,8 +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 , - (MSRCTL1_TXPWR |MSRCTL1_CSAPAREN )); +iowrite8 (MSRCTL1_TXPWR |MSRCTL1_CSAPAREN , priv->port_offset +MAC_REG_MSRCTL +1 );MACvSelectPage0 (priv->port_offset); }
@@ -349,9 +348,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 ); +iowrite8 (TFTCTL_TSFCNTRST , priv->port_offset +MAC_REG_TFTCTL );/* enable TSF counter */ -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTREN ); +iowrite8 (TFTCTL_TSFCNTREN , priv->port_offset +MAC_REG_TFTCTL );/* initialize BBP registers */ bb_vt3253_init (priv);
@@ -1060,7 +1059,7 @@ 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 ); +iowrite8 (0 , priv->port_offset +MAC_REG_SOFTPWRCTL );VNSvOutPortW (priv->port_offset +MAC_REG_SOFTPWRCTL ,SOFTPWRCTL_SWPECTI );device_error (priv, isr);
@@ -1477,10 +1476,8 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,CARDvSetFirstNextTBTT (priv, conf->beacon_int); }else { -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL , -TFTCTL_TSFCNTRST ); -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL , -TFTCTL_TSFCNTREN ); +iowrite8 (TFTCTL_TSFCNTRST , priv->port_offset +MAC_REG_TFTCTL ); +iowrite8 (TFTCTL_TSFCNTREN , priv->port_offset +MAC_REG_TFTCTL ); } } }
@@ -1561,7 +1558,7 @@ static void vnt_configure(struct ieee80211_hw *hw, rx_mode |=RCR_BSSID ; } -VNSvOutPortB (priv->port_offset +MAC_REG_RCR , rx_mode); +iowrite8 (rx_mode, priv->port_offset +MAC_REG_RCR );dev_dbg (&priv->pcid->dev,"rx mode out= %x\n" , rx_mode); }
@@ -1621,7 +1618,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 ); +iowrite8 (TFTCTL_TSFCNTRST , priv->port_offset +MAC_REG_TFTCTL ); }static const struct ieee80211_ops vnt_mac_ops = {
drivers/staging/vt6655/mac.h +17 -24
92 lines not on this page · raw message
drivers/staging/vt6655/rf.c +4 -4
@@ -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 ); +iowrite8 (0 , iobase +MAC_REG_SOFTPWRCTL );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 */ +iowrite8 ((u8)(PSSIG_WPE3 |PSSIG_WPE2 ), iobase +MAC_REG_PSPWRSIG );/* 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 )); +iowrite8 ((u8)(byChannel &0x7F ), iobase +MAC_REG_CHANNEL );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 )); +iowrite8 ((u8)(byChannel |0x80 ), iobase +MAC_REG_CHANNEL );return ret; }
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 ); +iowrite8 (TFTCTL_TSFCNTRST , priv->port_offset +MAC_REG_TFTCTL ); -VNSvOutPortB (priv->port_offset +MAC_REG_TFTCTL ,TFTCTL_TSFCNTREN ); +iowrite8 (TFTCTL_TSFCNTREN , priv->port_offset +MAC_REG_TFTCTL );CARDvSetFirstNextTBTT (priv, conf->beacon_int);
drivers/staging/vt6655/srom.c +5 -5
@@ -68,13 +68,13 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase, byData =0xFF ; byOrg =ioread8 (iobase +MAC_REG_I2MCFG );/* turn off hardware retry for getting NACK */ -VNSvOutPortB (iobase +MAC_REG_I2MCFG , (byOrg & (~I2MCFG_NORETRY ))); +iowrite8 ((u8)(byOrg & (~I2MCFG_NORETRY )), iobase +MAC_REG_I2MCFG );for (wNoACK =0 ; wNoACK <W_MAX_I2CRETRY ; wNoACK++) { -VNSvOutPortB (iobase +MAC_REG_I2MTGID ,EEP_I2C_DEV_ID ); -VNSvOutPortB (iobase +MAC_REG_I2MTGAD , byContntOffset); +iowrite8 (EEP_I2C_DEV_ID , iobase +MAC_REG_I2MTGID ); +iowrite8 (byContntOffset, iobase +MAC_REG_I2MTGAD );/* issue read command */ -VNSvOutPortB (iobase +MAC_REG_I2MCSR ,I2MCSR_EEMR ); +iowrite8 (I2MCSR_EEMR , iobase +MAC_REG_I2MCSR );/* wait DONE be set */ for (wDelay =0 ; wDelay <W_MAX_TIMEOUT ; wDelay++) { byWait =ioread8 (iobase +MAC_REG_I2MCSR );
@@ -88,7 +88,7 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase, } } byData =ioread8 (iobase +MAC_REG_I2MDIPT ); -VNSvOutPortB (iobase +MAC_REG_I2MCFG , byOrg); +iowrite8 (byOrg, iobase +MAC_REG_I2MCFG );return byData; }
drivers/staging/vt6655/upc.h +0 -3
@@ -20,9 +20,6 @@/* For memory mapped IO */ -#define VNSvOutPortB (dwIOAddress, byData) \ - iowrite8((u8)(byData), dwIOAddress) -#define VNSvOutPortW (dwIOAddress, wData) \ iowrite16((u16)(wData), dwIOAddress)
Signature · 1 line
2.25.1
Re: [PATCH v3 4/7] staging: vt6655: Replace VNSvOutPortB with iowrite8
Quoted 6 lines · Philipp Hortmann
Replace macro VNSvOutPortB with iowrite8.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.plFor constants from 0 to below
0x80the u8 cast was omitted. For variables which are defined as unsigned char the u8 is omitted.
I hate that GCC prints warnings for this. Useless. Horrible. But I understand that GCC does and we haven't figured out how to disable it or who needs to approve that.
But even then I still don't understand the casting in this patch.
Shouldn't the rule be to do the minimum work arounds to silence GCC? My understand is that the the casting is only needed when you're dealing with a bitwise negated constant. These are macros so the parameters might be constant so basically any bitwise negate gets a cast.
Quoted 18 lines
#define
MACvWordRegBitsOff(iobase, byRegOfs, wBits)\drivers/staging/vt6655/mac.h +0
-13@@ -578,37 +578,30 @@ do { \#define MACvWriteBSSIDAddress (iobase, pbyEtherAddr) \ do { \ - VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1); \ - VNSvOutPortB(iobase + MAC_REG_BSSID0, \ - *(pbyEtherAddr)); \ - VNSvOutPortB(iobase + MAC_REG_BSSID0 + 1, \ - *(pbyEtherAddr + 1)); \ - VNSvOutPortB(iobase + MAC_REG_BSSID0 + 2, \ - *(pbyEtherAddr + 2)); \ - VNSvOutPortB(iobase + MAC_REG_BSSID0 + 3, \ - *(pbyEtherAddr + 3)); \ - VNSvOutPortB(iobase + MAC_REG_BSSID0 + 4, \ - *(pbyEtherAddr + 4)); \ - VNSvOutPortB(iobase + MAC_REG_BSSID0 + 5, \ - *(pbyEtherAddr + 5)); \
drivers/staging/vt6655/mac.h do { \ · line 589
Quoted 10 lines
drivers/staging/vt6655/mac.h +8
-1-VNSvOutPortB (iobase +MAC_REG_PAGE1SEL ,0 ); \ +iowrite8 (1 , iobase +MAC_REG_PAGE1SEL ); \ +iowrite8 ((u8)*(pbyEtherAddr), iobase +MAC_REG_BSSID0 ); \ +iowrite8 ((u8)*(pbyEtherAddr +1 ), iobase +MAC_REG_BSSID0 +1 ); \ +iowrite8 ((u8)*(pbyEtherAddr +2 ), iobase +MAC_REG_BSSID0 +2 ); \ +iowrite8 ((u8)*(pbyEtherAddr +3 ), iobase +MAC_REG_BSSID0 +3 ); \ +iowrite8 ((u8)*(pbyEtherAddr +4 ), iobase +MAC_REG_BSSID0 +4 ); \ +iowrite8 ((u8)*(pbyEtherAddr +5 ), iobase +MAC_REG_BSSID0 +5 ); \ +iowrite8 (0 , iobase +MAC_REG_PAGE1SEL ); \ }while (0 )
If these casts are required then the pointer math is wrong. #SeriousBug I looked at the caller and these casts are not required. Just remove the casts.
drivers/staging/vt6655/mac.h do { \ · line 661
Quoted 8 lines
drivers/staging/vt6655/mac.h +1
-1#define MACvClearStckDS (iobase) \ do { \ unsigned char byOrgValue; \ byOrgValue = ioread8(iobase + MAC_REG_STICKHW); \ byOrgValue = byOrgValue & 0xFC; \ - VNSvOutPortB(iobase + MAC_REG_STICKHW, byOrgValue); \ + iowrite8((u8)byOrgValue, iobase + MAC_REG_STICKHW); \ } while (0)
This cast is definitely not required. byOrgValue is declared as local to the block so we know it's unsigned char.
drivers/staging/vt6655/srom.c unsigned char SROMbyReadEmbedded(void __iomem *iobase, · line 71
Quoted 10 lines
drivers/staging/vt6655/srom.c +1
-1@@ -68,13 +68,13 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase, byData =0xFF ; byOrg =ioread8 (iobase +MAC_REG_I2MCFG );/* turn off hardware retry for getting NACK */ -VNSvOutPortB (iobase +MAC_REG_I2MCFG , (byOrg & (~I2MCFG_NORETRY ))); +iowrite8 ((u8)(byOrg & (~I2MCFG_NORETRY )), iobase +MAC_REG_I2MCFG );
In this case we have a bitwise negate but it's ANDed with a u8 so there is no cast required (hopefully 0_0).
regards,
dan carpenter
Re: [PATCH v3 4/7] staging: vt6655: Replace VNSvOutPortB with iowrite8
Quoted 11 lines · Dan Carpenter
Quoted 6 lines · Philipp Hortmann
Replace macro VNSvOutPortB with iowrite8.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.plFor constants from 0 to below
0x80the u8 cast was omitted. For variables which are defined as unsigned char the u8 is omitted.I hate that GCC prints warnings for this. Useless. Horrible. But I understand that GCC does and we haven't figured out how to disable it or who needs to approve that.
Quoted 7 lines
But even then I still don't understand the casting in this patch.
Shouldn't the rule be to do the minimum work arounds to silence GCC? My understand is that the the casting is only needed when you're dealing with a bitwise negated constant. These are macros so the parameters might be constant so basically any bitwise negate gets a cast.
Please send me the compiler flags you are using. I was using:
make "KCFLAGS=-pipe -Wall" -C . M=drivers/staging/vt6655/ But of course more flags are set.
I did not see any compiler warnings.
Thanks
Regards,
Philipp Hortmann
Re: [PATCH v3 4/7] staging: vt6655: Replace VNSvOutPortB with iowrite8
Quoted 20 lines · Philipp Hortmann
Quoted 11 lines · Dan Carpenter
Quoted 6 lines · Philipp Hortmann
Replace macro VNSvOutPortB with iowrite8.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.plFor constants from 0 to below
0x80the u8 cast was omitted. For variables which are defined as unsigned char the u8 is omitted.I hate that GCC prints warnings for this. Useless. Horrible. But I understand that GCC does and we haven't figured out how to disable it or who needs to approve that.
Quoted 7 lines
But even then I still don't understand the casting in this patch.
Shouldn't the rule be to do the minimum work arounds to silence GCC? My understand is that the the casting is only needed when you're dealing with a bitwise negated constant. These are macros so the parameters might be constant so basically any bitwise negate gets a cast.
Quoted 5 lines
Please send me the compiler flags you are using. I was using:
make "KCFLAGS=-pipe -Wall" -C . M=drivers/staging/vt6655/ But of course more flags are set.
I did not see any compiler warnings.
I think I was not clear.
Why are you doing these casts? I do not like any of them, and wish we could remove them.
My understanding is that if you remove the casts kbuild will complain and the build will fail on certain architectures. But I have not tried to compile this. If we can remove all the casting let's do that, but if we can only remove some then lets do that.
regards,
dan carpenter
Greg Kroah-Hartman
maintainerRe: [PATCH v3 4/7] staging: vt6655: Replace VNSvOutPortB with iowrite8
In reply to Philipp HortmannQuoted 20 lines · Philipp Hortmann
Quoted 11 lines · Dan Carpenter
Quoted 6 lines · Philipp Hortmann
Replace macro VNSvOutPortB with iowrite8.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.plFor constants from 0 to below
0x80the u8 cast was omitted. For variables which are defined as unsigned char the u8 is omitted.I hate that GCC prints warnings for this. Useless. Horrible. But I understand that GCC does and we haven't figured out how to disable it or who needs to approve that.
Quoted 7 lines
But even then I still don't understand the casting in this patch.
Shouldn't the rule be to do the minimum work arounds to silence GCC? My understand is that the the casting is only needed when you're dealing with a bitwise negated constant. These are macros so the parameters might be constant so basically any bitwise negate gets a cast.
Quoted 3 lines
Please send me the compiler flags you are using. I was using:
make "KCFLAGS=-pipe -Wall" -C . M=drivers/staging/vt6655/
Why are you adding random flags to the build? Just stick with the default ones, that's all you need.
thanks,
greg k-h
PATCH v3 5/7 staging: vt6655: Replace VNSvOutPortW with iowrite16
In reply to Philipp HortmannReplace macro VNSvOutPortW with iowrite16.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.pl
For constants from 0 to below 0x8000 the u16 cast was omitted. For variables which are defined as unsigned short the u16 is omitted.
Since there are more than one checkpatch issue per line, more steps are rquired to fix.
---
V1 -> V2: Patch was not existing
V2 -> V3: Inserted patch that was before in a different way in
"Rename macros VNSvOutPortB,W,D"
This patch was part of 5/6 and is now 5/7
--- drivers/staging/vt6655/card.c | 29 ++++++++++------------------ drivers/staging/vt6655/device_main.c | 3 +-- drivers/staging/vt6655/mac.h | 7 +++---- drivers/staging/vt6655/power.c | 4 ++-- drivers/staging/vt6655/rf.c | 2 +- drivers/staging/vt6655/upc.h | 3 --- 6 files changed, 17 insertions(+), 31 deletions(-)
drivers/staging/vt6655/card.c +10 -19
@@ -327,7 +327,7 @@ bool CARDbSetBeaconPeriod(struct vnt_private *priv, qwNextTBTT =CARDqGetNextTBTT (qwNextTBTT, wBeaconInterval);/* set HW beacon interval */ -VNSvOutPortW (priv->port_offset +MAC_REG_BI , wBeaconInterval); +iowrite16 (wBeaconInterval, priv->port_offset +MAC_REG_BI ); priv->wBeaconInterval = wBeaconInterval;/* Set NextTBTT */ VNSvOutPortD (priv->port_offset +MAC_REG_NEXTTBTT , (u32 )qwNextTBTT);
@@ -588,68 +588,59 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type) bb_type, &byTxRate, &byRsvTime); -VNSvOutPortW (priv->port_offset +MAC_REG_RSPINF_A_6 , -MAKEWORD (byTxRate, byRsvTime)); +iowrite16 (MAKEWORD (byTxRate, byRsvTime), priv->port_offset +MAC_REG_RSPINF_A_6 );/* RSPINF_a_9 */ s_vCalculateOFDMRParameter (RATE_9M , bb_type, &byTxRate, &byRsvTime); -VNSvOutPortW (priv->port_offset +MAC_REG_RSPINF_A_9 , -MAKEWORD (byTxRate, byRsvTime)); +iowrite16 (MAKEWORD (byTxRate, byRsvTime), priv->port_offset +MAC_REG_RSPINF_A_9 );/* RSPINF_a_12 */ s_vCalculateOFDMRParameter (RATE_12M , bb_type, &byTxRate, &byRsvTime); -VNSvOutPortW (priv->port_offset +MAC_REG_RSPINF_A_12 , -MAKEWORD (byTxRate, byRsvTime)); +iowrite16 (MAKEWORD (byTxRate, byRsvTime), priv->port_offset +MAC_REG_RSPINF_A_12 );/* RSPINF_a_18 */ s_vCalculateOFDMRParameter (RATE_18M , bb_type, &byTxRate, &byRsvTime); -VNSvOutPortW (priv->port_offset +MAC_REG_RSPINF_A_18 , -MAKEWORD (byTxRate, byRsvTime)); +iowrite16 (MAKEWORD (byTxRate, byRsvTime), priv->port_offset +MAC_REG_RSPINF_A_18 );/* RSPINF_a_24 */ s_vCalculateOFDMRParameter (RATE_24M , bb_type, &byTxRate, &byRsvTime); -VNSvOutPortW (priv->port_offset +MAC_REG_RSPINF_A_24 , -MAKEWORD (byTxRate, byRsvTime)); +iowrite16 (MAKEWORD (byTxRate, byRsvTime), priv->port_offset +MAC_REG_RSPINF_A_24 );/* RSPINF_a_36 */ s_vCalculateOFDMRParameter (CARDwGetOFDMControlRate ((void *)priv,RATE_36M ), bb_type, &byTxRate, &byRsvTime); -VNSvOutPortW (priv->port_offset +MAC_REG_RSPINF_A_36 , -MAKEWORD (byTxRate, byRsvTime)); +iowrite16 (MAKEWORD (byTxRate, byRsvTime), priv->port_offset +MAC_REG_RSPINF_A_36 );/* RSPINF_a_48 */ s_vCalculateOFDMRParameter (CARDwGetOFDMControlRate ((void *)priv,RATE_48M ), bb_type, &byTxRate, &byRsvTime); -VNSvOutPortW (priv->port_offset +MAC_REG_RSPINF_A_48 , -MAKEWORD (byTxRate, byRsvTime)); +iowrite16 (MAKEWORD (byTxRate, byRsvTime), priv->port_offset +MAC_REG_RSPINF_A_48 );/* RSPINF_a_54 */ s_vCalculateOFDMRParameter (CARDwGetOFDMControlRate ((void *)priv,RATE_54M ), bb_type, &byTxRate, &byRsvTime); -VNSvOutPortW (priv->port_offset +MAC_REG_RSPINF_A_54 , -MAKEWORD (byTxRate, byRsvTime)); +iowrite16 (MAKEWORD (byTxRate, byRsvTime), priv->port_offset +MAC_REG_RSPINF_A_54 );/* RSPINF_a_72 */ s_vCalculateOFDMRParameter (CARDwGetOFDMControlRate ((void *)priv,RATE_54M ), bb_type, &byTxRate, &byRsvTime); -VNSvOutPortW (priv->port_offset +MAC_REG_RSPINF_A_72 , -MAKEWORD (byTxRate, byRsvTime)); +iowrite16 (MAKEWORD (byTxRate, byRsvTime), priv->port_offset +MAC_REG_RSPINF_A_72 );/* Set to Page0 */ MACvSelectPage0 (priv->port_offset);
drivers/staging/vt6655/device_main.c +1 -2
@@ -1060,8 +1060,7 @@ static void vnt_interrupt_process(struct vnt_private *priv)if (isr &ISR_FETALERR ) {pr_debug (" ISR_FETALERR\n" );iowrite8 (0 , priv->port_offset +MAC_REG_SOFTPWRCTL ); -VNSvOutPortW (priv->port_offset + -MAC_REG_SOFTPWRCTL ,SOFTPWRCTL_SWPECTI ); +iowrite16 (SOFTPWRCTL_SWPECTI , priv->port_offset +MAC_REG_SOFTPWRCTL );device_error (priv, isr); }
drivers/staging/vt6655/mac.h +3 -4
@@ -549,7 +549,7 @@ do { \do { \unsigned short wData; \ wData =ioread16 (iobase + byRegOfs); \ -VNSvOutPortW (iobase + byRegOfs, wData | (wBits)); \ +iowrite16 ((u16)(wData | (wBits)), iobase + byRegOfs); \ } while (0)#define MACvRegBitsOff (iobase, byRegOfs, byBits) \
@@ -563,7 +563,7 @@ do { \do { \unsigned short wData; \ wData =ioread16 (iobase + byRegOfs); \ -VNSvOutPortW (iobase + byRegOfs, wData & ~(wBits)); \ +iowrite16 ((u16)(wData & ~(wBits)), iobase + byRegOfs); \ }while (0 )/* set the chip with current BCN tx descriptor address */
@@ -573,8 +573,7 @@ do { \/* set the chip with current BCN length */ #define MACvSetCurrBCNLength (iobase, wCurrBCNLength) \ - VNSvOutPortW(iobase + MAC_REG_BCNDMACTL + 2, \ - wCurrBCNLength) + iowrite16((u16)(wCurrBCNLength), iobase + MAC_REG_BCNDMACTL + 2)#define MACvWriteBSSIDAddress (iobase, pbyEtherAddr) \ do { \
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 ); +iowrite16 (C_PWBT , priv->port_offset +MAC_REG_PWBT );if (priv->op_mode !=NL80211_IFTYPE_ADHOC ) {/* set AID */ -VNSvOutPortW (priv->port_offset +MAC_REG_AIDATIM , wAID); +iowrite16 (wAID, priv->port_offset +MAC_REG_AIDATIM ); }/* Set AutoSleep */
drivers/staging/vt6655/rf.c +1 -1
@@ -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 ); +iowrite16 (0 , iobase +MAC_REG_MISCFFNDEX );switch (rf_type) {case RF_AIROHA :case RF_AL2230S :
drivers/staging/vt6655/upc.h +0 -3
@@ -20,9 +20,6 @@/* For memory mapped IO */ -#define VNSvOutPortW (dwIOAddress, wData) \ - iowrite16((u16)(wData), dwIOAddress) -#define VNSvOutPortD (dwIOAddress, dwData) \ iowrite32((u32)(dwData), dwIOAddress)
Signature · 1 line
2.25.1
PATCH v3 6/7 staging: vt6655: Replace VNSvOutPortD with iowrite32
In reply to Philipp HortmannReplace macro VNSvOutPortD with iowrite32.
The name of macro and the arguments use CamelCase which is not accepted by checkpatch.pl
For constants from 0 to below 0x80000000 the u32 cast was omitted. For variables which are defined as unsigned long the u32 is omitted.
Since there are more than one checkpatch issue per line, more steps are rquired to fix.
---
V1 -> V2: Patch was not existing
V2 -> V3: Inserted patch that was before in a different way in
"Rename macros VNSvOutPortB,W,D"
This patch was part of 5/6 and is now 6/7
--- drivers/staging/vt6655/baseband.c | 2 +- drivers/staging/vt6655/card.c | 27 +++++++++---------- drivers/staging/vt6655/device_main.c | 14 ++++------ drivers/staging/vt6655/mac.h | 39 ++++++++++++++-------------- drivers/staging/vt6655/rf.c | 2 +- drivers/staging/vt6655/upc.h | 3 --- 6 files changed, 38 insertions(+), 49 deletions(-)
drivers/staging/vt6655/baseband.c +1 -1
@@ -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 ); +iowrite32 (0x23 , iobase +MAC_REG_ITRTMSET );MACvRegBitsOn (iobase,MAC_REG_PAPEDELAY ,BIT (0 )); } priv->abyBBVGA[0 ] =0x18 ;
drivers/staging/vt6655/card.c +12 -15
@@ -294,10 +294,8 @@ bool CARDbUpdateTSF(struct vnt_private *priv, unsigned char byRxRate, qwTSFOffset =CARDqGetTSFOffset (byRxRate, qwBSSTimestamp, local_tsf);/* adjust TSF, HW's TSF add TSF Offset reg */ -VNSvOutPortD (priv->port_offset +MAC_REG_TSFOFST , - (u32 )qwTSFOffset); -VNSvOutPortD (priv->port_offset +MAC_REG_TSFOFST +4 , - (u32)(qwTSFOffset >>32 )); +iowrite32 ((u32 )qwTSFOffset, priv->port_offset +MAC_REG_TSFOFST ); +iowrite32 ((u32)(qwTSFOffset >>32 ), priv->port_offset +MAC_REG_TSFOFST +4 );MACvRegBitsOn (priv->port_offset,MAC_REG_TFTCTL ,TFTCTL_TSFSYNCEN ); }
@@ -330,9 +328,8 @@ bool CARDbSetBeaconPeriod(struct vnt_private *priv,iowrite16 (wBeaconInterval, priv->port_offset +MAC_REG_BI ); priv->wBeaconInterval = wBeaconInterval;/* Set NextTBTT */ -VNSvOutPortD (priv->port_offset +MAC_REG_NEXTTBTT , (u32 )qwNextTBTT); -VNSvOutPortD (priv->port_offset +MAC_REG_NEXTTBTT +4 , - (u32)(qwNextTBTT >>32 )); +iowrite32 ((u32 )qwNextTBTT, priv->port_offset +MAC_REG_NEXTTBTT ); +iowrite32 ((u32)(qwNextTBTT >>32 ), priv->port_offset +MAC_REG_NEXTTBTT +4 );MACvRegBitsOn (priv->port_offset,MAC_REG_TFTCTL ,TFTCTL_TBTTSYNCEN );return true;
@@ -554,7 +551,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type)/* swap over to get correct write order */ swap (phy.swap[0 ], phy.swap[1 ]); -VNSvOutPortD (priv->port_offset +MAC_REG_RSPINF_B_1 , phy.field_write); +iowrite32 (phy.field_write, priv->port_offset +MAC_REG_RSPINF_B_1 );/* RSPINF_b_2 */ vnt_get_phy_field(priv, 14,
@@ -563,7 +560,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type)swap (phy.swap[0 ], phy.swap[1 ]); -VNSvOutPortD (priv->port_offset +MAC_REG_RSPINF_B_2 , phy.field_write); +iowrite32 (phy.field_write, priv->port_offset +MAC_REG_RSPINF_B_2 );/* RSPINF_b_5 */ vnt_get_phy_field(priv, 14,
@@ -572,7 +569,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type)swap (phy.swap[0 ], phy.swap[1 ]); -VNSvOutPortD (priv->port_offset +MAC_REG_RSPINF_B_5 , phy.field_write); +iowrite32 (phy.field_write, priv->port_offset +MAC_REG_RSPINF_B_5 );/* RSPINF_b_11 */ vnt_get_phy_field(priv, 14,
@@ -581,7 +578,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type)swap (phy.swap[0 ], phy.swap[1 ]); -VNSvOutPortD (priv->port_offset +MAC_REG_RSPINF_B_11 , phy.field_write); +iowrite32 (phy.field_write, priv->port_offset +MAC_REG_RSPINF_B_11 );/* RSPINF_a_6 */ s_vCalculateOFDMRParameter(RATE_6M,
@@ -800,8 +797,8 @@ void CARDvSetFirstNextTBTT(struct vnt_private *priv, qwNextTBTT =CARDqGetNextTBTT (qwNextTBTT, wBeaconInterval);/* Set NextTBTT */ -VNSvOutPortD (iobase +MAC_REG_NEXTTBTT , (u32 )qwNextTBTT); -VNSvOutPortD (iobase +MAC_REG_NEXTTBTT +4 , (u32)(qwNextTBTT >>32 )); +iowrite32 ((u32 )qwNextTBTT, iobase +MAC_REG_NEXTTBTT ); +iowrite32 ((u32)(qwNextTBTT >>32 ), iobase +MAC_REG_NEXTTBTT +4 );MACvRegBitsOn (iobase,MAC_REG_TFTCTL ,TFTCTL_TBTTSYNCEN ); }
@@ -826,8 +823,8 @@ void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF, qwTSF =CARDqGetNextTBTT (qwTSF, wBeaconInterval);/* Set NextTBTT */ -VNSvOutPortD (iobase +MAC_REG_NEXTTBTT , (u32 )qwTSF); -VNSvOutPortD (iobase +MAC_REG_NEXTTBTT +4 , (u32)(qwTSF >>32 )); +iowrite32 ((u32 )qwTSF, iobase +MAC_REG_NEXTTBTT ); +iowrite32 ((u32)(qwTSF >>32 ), iobase +MAC_REG_NEXTTBTT +4 );MACvRegBitsOn (iobase,MAC_REG_TFTCTL ,TFTCTL_TBTTSYNCEN );pr_debug ("Card:Update Next TBTT[%8llx]\n" , qwTSF); }
drivers/staging/vt6655/device_main.c +5 -9
@@ -1522,20 +1522,16 @@ static void vnt_configure(struct ieee80211_hw *hw,if (priv->mc_list_count >2 ) {MACvSelectPage1 (priv->port_offset); -VNSvOutPortD (priv->port_offset + -MAC_REG_MAR0 ,0xffffffff ); -VNSvOutPortD (priv->port_offset + -MAC_REG_MAR0 +4 ,0xffffffff ); +iowrite32 ((u32 )0xffffffff , priv->port_offset +MAC_REG_MAR0 ); +iowrite32 ((u32 )0xffffffff , priv->port_offset +MAC_REG_MAR0 +4 );MACvSelectPage0 (priv->port_offset); }else {MACvSelectPage1 (priv->port_offset); -VNSvOutPortD (priv->port_offset + -MAC_REG_MAR0 , (u32 )multicast); -VNSvOutPortD (priv->port_offset + -MAC_REG_MAR0 +4 , - (u32)(multicast >>32 )); +iowrite32 ((u32 )multicast, priv->port_offset +MAC_REG_MAR0 ); +iowrite32 ((u32)(multicast >>32 ), + priv->port_offset +MAC_REG_MAR0 +4 );MACvSelectPage0 (priv->port_offset); }
drivers/staging/vt6655/mac.h +19 -20
@@ -568,8 +568,7 @@ do { \/* set the chip with current BCN tx descriptor address */ #define MACvSetCurrBCNTxDescAddr (iobase, dwCurrDescAddr) \ - VNSvOutPortD(iobase + MAC_REG_BCNDMAPTR, \ - dwCurrDescAddr) + iowrite32((u32)(dwCurrDescAddr), iobase + MAC_REG_BCNDMAPTR)/* set the chip with current BCN length */ #define MACvSetCurrBCNLength (iobase, wCurrBCNLength) \
@@ -603,19 +602,19 @@ do { \ iowrite8(HOSTCR_MACEN | HOSTCR_RXON | HOSTCR_TXON, iobase + MAC_REG_HOSTCR)#define MACvRx0PerPktMode (iobase) \ - VNSvOutPortD(iobase + MAC_REG_RXDMACTL0, RX_PERPKT) + iowrite32(RX_PERPKT, iobase + MAC_REG_RXDMACTL0)#define MACvRx1PerPktMode (iobase) \ - VNSvOutPortD(iobase + MAC_REG_RXDMACTL1, RX_PERPKT) + iowrite32(RX_PERPKT, iobase + MAC_REG_RXDMACTL1)#define MACvReceive0 (iobase) \ do { \ unsigned long dwData; \ dwData = ioread32(iobase + MAC_REG_RXDMACTL0); \ if (dwData & DMACTL_RUN) \ - VNSvOutPortD(iobase + MAC_REG_RXDMACTL0, DMACTL_WAKE); \ + iowrite32(DMACTL_WAKE, iobase + MAC_REG_RXDMACTL0); \ else \ - VNSvOutPortD(iobase + MAC_REG_RXDMACTL0, DMACTL_RUN); \ + iowrite32(DMACTL_RUN, iobase + MAC_REG_RXDMACTL0); \ } while (0)#define MACvReceive1 (iobase) \
@@ -623,9 +622,9 @@ do { \unsigned long dwData; \ dwData =ioread32 (iobase +MAC_REG_RXDMACTL1 ); \if (dwData &DMACTL_RUN ) \ -VNSvOutPortD (iobase +MAC_REG_RXDMACTL1 ,DMACTL_WAKE ); \ +iowrite32 (DMACTL_WAKE , iobase +MAC_REG_RXDMACTL1 ); \else \ -VNSvOutPortD (iobase +MAC_REG_RXDMACTL1 ,DMACTL_RUN ); \ +iowrite32 (DMACTL_RUN , iobase +MAC_REG_RXDMACTL1 ); \ }while (0 ) #define MACvTransmit0(iobase) \
@@ -633,9 +632,9 @@ do { \unsigned long dwData; \ dwData =ioread32 (iobase +MAC_REG_TXDMACTL0 ); \if (dwData &DMACTL_RUN ) \ -VNSvOutPortD (iobase +MAC_REG_TXDMACTL0 ,DMACTL_WAKE ); \ +iowrite32 (DMACTL_WAKE , iobase +MAC_REG_TXDMACTL0 ); \else \ -VNSvOutPortD (iobase +MAC_REG_TXDMACTL0 ,DMACTL_RUN ); \ +iowrite32 (DMACTL_RUN , iobase +MAC_REG_TXDMACTL0 ); \ }while (0 ) #define MACvTransmitAC0(iobase) \
@@ -643,9 +642,9 @@ do { \unsigned long dwData; \ dwData =ioread32 (iobase +MAC_REG_AC0DMACTL ); \if (dwData &DMACTL_RUN ) \ -VNSvOutPortD (iobase +MAC_REG_AC0DMACTL ,DMACTL_WAKE ); \ +iowrite32 (DMACTL_WAKE , iobase +MAC_REG_AC0DMACTL ); \else \ -VNSvOutPortD (iobase +MAC_REG_AC0DMACTL ,DMACTL_RUN ); \ +iowrite32 (DMACTL_RUN , iobase +MAC_REG_AC0DMACTL ); \ }while (0 ) #define MACvTransmitBCN(iobase) \
@@ -663,13 +662,13 @@ do { \ *(pdwValue) = ioread32(iobase + MAC_REG_ISR)#define MACvWriteISR (iobase, dwValue) \ - VNSvOutPortD(iobase + MAC_REG_ISR, dwValue) + iowrite32((u32)(dwValue), iobase + MAC_REG_ISR)#define MACvIntEnable (iobase, dwMask) \ - VNSvOutPortD(iobase + MAC_REG_IMR, dwMask) + iowrite32((u32)(dwMask), iobase + MAC_REG_IMR)#define MACvIntDisable (iobase) \ - VNSvOutPortD(iobase + MAC_REG_IMR, 0) + iowrite32(0, iobase + MAC_REG_IMR)#define MACvSelectPage0 (iobase) \ iowrite8(0, iobase + MAC_REG_PAGE1SEL)
@@ -685,7 +684,7 @@ do { \unsigned long dwOrgValue; \ dwOrgValue =ioread32 (iobase +MAC_REG_ENCFG ); \ dwOrgValue = dwOrgValue |ENCFG_PROTECTMD ; \ -VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ +iowrite32 ((u32)(dwOrgValue), iobase +MAC_REG_ENCFG ); \ }while (0 ) #define MACvDisableProtectMD(iobase) \
@@ -693,7 +692,7 @@ do { \unsigned long dwOrgValue; \ dwOrgValue =ioread32 (iobase +MAC_REG_ENCFG ); \ dwOrgValue = dwOrgValue & ~ENCFG_PROTECTMD ; \ -VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ +iowrite32 ((u32)(dwOrgValue), iobase +MAC_REG_ENCFG ); \ }while (0 ) #define MACvEnableBarkerPreambleMd(iobase) \
@@ -701,7 +700,7 @@ do { \unsigned long dwOrgValue; \ dwOrgValue =ioread32 (iobase +MAC_REG_ENCFG ); \ dwOrgValue = dwOrgValue |ENCFG_BARKERPREAM ; \ -VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ +iowrite32 ((u32)(dwOrgValue), iobase +MAC_REG_ENCFG ); \ }while (0 ) #define MACvDisableBarkerPreambleMd(iobase) \
@@ -709,7 +708,7 @@ do { \unsigned long dwOrgValue; \ dwOrgValue =ioread32 (iobase +MAC_REG_ENCFG ); \ dwOrgValue = dwOrgValue & ~ENCFG_BARKERPREAM ; \ -VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ +iowrite32 ((u32)(dwOrgValue), iobase +MAC_REG_ENCFG ); \ }while (0 ) #define MACvSetBBType(iobase, byTyp) \
@@ -718,7 +717,7 @@ do { \ dwOrgValue =ioread32 (iobase +MAC_REG_ENCFG ); \ dwOrgValue = dwOrgValue & ~ENCFG_BBTYPE_MASK ; \ dwOrgValue = dwOrgValue | (unsigned long )byTyp; \ -VNSvOutPortD (iobase +MAC_REG_ENCFG , dwOrgValue); \ +iowrite32 ((u32)(dwOrgValue), iobase +MAC_REG_ENCFG ); \ }while (0 ) #define MACvGPIOIn(iobase, pbyValue) \
drivers/staging/vt6655/rf.c +1 -1
@@ -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); +iowrite32 (dwData, iobase +MAC_REG_IFREGCTL );/* W_MAX_TIMEOUT is the timeout period */ for (ww =0 ; ww <W_MAX_TIMEOUT ; ww++) {
drivers/staging/vt6655/upc.h +0 -3
@@ -20,9 +20,6 @@/* For memory mapped IO */ -#define VNSvOutPortD (dwIOAddress, dwData) \ - iowrite32((u32)(dwData), dwIOAddress) -#define PCAvDelayByIO (uDelayUnit) \ do { \ unsigned char __maybe_unused byData; \
Signature · 1 line
2.25.1
PATCH v3 7/7 staging: vt6655: Remove macro PCAvDelayByIO
In reply to Philipp HortmannRemove do-while(0) and CamelCase macro PCAvDelayByIO as it is not accepted by checkpatch.pl
As the macro is just used once with a constant <= 50 the functionality of the macro is implemented by using udelay() directly.
---
V1 -> V2: Changed converting macro to function to delete macro
This patch was 7/7 and is now 6/6
V2 -> V3: No changes
This patch was 6/6 and is now 7/7
--- drivers/staging/vt6655/srom.c | 2 +- drivers/staging/vt6655/upc.h | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-)
drivers/staging/vt6655/srom.c +1 -1
@@ -80,7 +80,7 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase, byWait =ioread8 (iobase +MAC_REG_I2MCSR );if (byWait & (I2MCSR_DONE |I2MCSR_NACK ))break ; -PCAvDelayByIO (CB_DELAY_LOOP_WAIT ); +udelay (CB_DELAY_LOOP_WAIT ); }if ((wDelay <W_MAX_TIMEOUT ) && (!(byWait &I2MCSR_NACK ))) {
drivers/staging/vt6655/upc.h +0 -13
@@ -20,19 +20,6 @@/* For memory mapped IO */ -#define PCAvDelayByIO (uDelayUnit) \ -do { \ - unsigned char __maybe_unused byData; \ - unsigned long ii; \ - \ - if (uDelayUnit <= 50) { \ - udelay(uDelayUnit); \ - } else { \ - for (ii = 0; ii < (uDelayUnit); ii++) \ - byData = inb(0x61); \ - } \ -} while (0) -/*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Variables --------------------------*/
Signature · 1 line
2.25.1