Commit 64b9d16e authored by Nathan Chancellor's avatar Nathan Chancellor Committed by David S. Miller

atm: zatm: Fix empty body Clang warnings

Clang warns:

drivers/atm/zatm.c:513:7: error: while loop has empty body
[-Werror,-Wempty-body]
        zwait;
             ^
drivers/atm/zatm.c:513:7: note: put the semicolon on a separate line to
silence this warning

Get rid of this warning by using an empty do-while loop. While we're at
it, add parentheses to make it clear that this is a function-like macro.

Link: https://github.com/ClangBuiltLinux/linux/issues/42Suggested-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3e73cc5c
...@@ -126,7 +126,7 @@ static unsigned long dummy[2] = {0,0}; ...@@ -126,7 +126,7 @@ static unsigned long dummy[2] = {0,0};
#define zin_n(r) inl(zatm_dev->base+r*4) #define zin_n(r) inl(zatm_dev->base+r*4)
#define zin(r) inl(zatm_dev->base+uPD98401_##r*4) #define zin(r) inl(zatm_dev->base+uPD98401_##r*4)
#define zout(v,r) outl(v,zatm_dev->base+uPD98401_##r*4) #define zout(v,r) outl(v,zatm_dev->base+uPD98401_##r*4)
#define zwait while (zin(CMR) & uPD98401_BUSY) #define zwait() do {} while (zin(CMR) & uPD98401_BUSY)
/* RX0, RX1, TX0, TX1 */ /* RX0, RX1, TX0, TX1 */
static const int mbx_entries[NR_MBX] = { 1024,1024,1024,1024 }; static const int mbx_entries[NR_MBX] = { 1024,1024,1024,1024 };
...@@ -140,7 +140,7 @@ static const int mbx_esize[NR_MBX] = { 16,16,4,4 }; /* entry size in bytes */ ...@@ -140,7 +140,7 @@ static const int mbx_esize[NR_MBX] = { 16,16,4,4 }; /* entry size in bytes */
static void zpokel(struct zatm_dev *zatm_dev,u32 value,u32 addr) static void zpokel(struct zatm_dev *zatm_dev,u32 value,u32 addr)
{ {
zwait; zwait();
zout(value,CER); zout(value,CER);
zout(uPD98401_IND_ACC | uPD98401_IA_BALL | zout(uPD98401_IND_ACC | uPD98401_IA_BALL |
(uPD98401_IA_TGT_CM << uPD98401_IA_TGT_SHIFT) | addr,CMR); (uPD98401_IA_TGT_CM << uPD98401_IA_TGT_SHIFT) | addr,CMR);
...@@ -149,10 +149,10 @@ static void zpokel(struct zatm_dev *zatm_dev,u32 value,u32 addr) ...@@ -149,10 +149,10 @@ static void zpokel(struct zatm_dev *zatm_dev,u32 value,u32 addr)
static u32 zpeekl(struct zatm_dev *zatm_dev,u32 addr) static u32 zpeekl(struct zatm_dev *zatm_dev,u32 addr)
{ {
zwait; zwait();
zout(uPD98401_IND_ACC | uPD98401_IA_BALL | uPD98401_IA_RW | zout(uPD98401_IND_ACC | uPD98401_IA_BALL | uPD98401_IA_RW |
(uPD98401_IA_TGT_CM << uPD98401_IA_TGT_SHIFT) | addr,CMR); (uPD98401_IA_TGT_CM << uPD98401_IA_TGT_SHIFT) | addr,CMR);
zwait; zwait();
return zin(CER); return zin(CER);
} }
...@@ -241,7 +241,7 @@ static void refill_pool(struct atm_dev *dev,int pool) ...@@ -241,7 +241,7 @@ static void refill_pool(struct atm_dev *dev,int pool)
} }
if (first) { if (first) {
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
zwait; zwait();
zout(virt_to_bus(first),CER); zout(virt_to_bus(first),CER);
zout(uPD98401_ADD_BAT | (pool << uPD98401_POOL_SHIFT) | count, zout(uPD98401_ADD_BAT | (pool << uPD98401_POOL_SHIFT) | count,
CMR); CMR);
...@@ -508,9 +508,9 @@ static int open_rx_first(struct atm_vcc *vcc) ...@@ -508,9 +508,9 @@ static int open_rx_first(struct atm_vcc *vcc)
} }
if (zatm_vcc->pool < 0) return -EMSGSIZE; if (zatm_vcc->pool < 0) return -EMSGSIZE;
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
zwait; zwait();
zout(uPD98401_OPEN_CHAN,CMR); zout(uPD98401_OPEN_CHAN,CMR);
zwait; zwait();
DPRINTK("0x%x 0x%x\n",zin(CMR),zin(CER)); DPRINTK("0x%x 0x%x\n",zin(CMR),zin(CER));
chan = (zin(CMR) & uPD98401_CHAN_ADDR) >> uPD98401_CHAN_ADDR_SHIFT; chan = (zin(CMR) & uPD98401_CHAN_ADDR) >> uPD98401_CHAN_ADDR_SHIFT;
spin_unlock_irqrestore(&zatm_dev->lock, flags); spin_unlock_irqrestore(&zatm_dev->lock, flags);
...@@ -571,21 +571,21 @@ static void close_rx(struct atm_vcc *vcc) ...@@ -571,21 +571,21 @@ static void close_rx(struct atm_vcc *vcc)
pos = vcc->vci >> 1; pos = vcc->vci >> 1;
shift = (1-(vcc->vci & 1)) << 4; shift = (1-(vcc->vci & 1)) << 4;
zpokel(zatm_dev,zpeekl(zatm_dev,pos) & ~(0xffff << shift),pos); zpokel(zatm_dev,zpeekl(zatm_dev,pos) & ~(0xffff << shift),pos);
zwait; zwait();
zout(uPD98401_NOP,CMR); zout(uPD98401_NOP,CMR);
zwait; zwait();
zout(uPD98401_NOP,CMR); zout(uPD98401_NOP,CMR);
spin_unlock_irqrestore(&zatm_dev->lock, flags); spin_unlock_irqrestore(&zatm_dev->lock, flags);
} }
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
zwait; zwait();
zout(uPD98401_DEACT_CHAN | uPD98401_CHAN_RT | (zatm_vcc->rx_chan << zout(uPD98401_DEACT_CHAN | uPD98401_CHAN_RT | (zatm_vcc->rx_chan <<
uPD98401_CHAN_ADDR_SHIFT),CMR); uPD98401_CHAN_ADDR_SHIFT),CMR);
zwait; zwait();
udelay(10); /* why oh why ... ? */ udelay(10); /* why oh why ... ? */
zout(uPD98401_CLOSE_CHAN | uPD98401_CHAN_RT | (zatm_vcc->rx_chan << zout(uPD98401_CLOSE_CHAN | uPD98401_CHAN_RT | (zatm_vcc->rx_chan <<
uPD98401_CHAN_ADDR_SHIFT),CMR); uPD98401_CHAN_ADDR_SHIFT),CMR);
zwait; zwait();
if (!(zin(CMR) & uPD98401_CHAN_ADDR)) if (!(zin(CMR) & uPD98401_CHAN_ADDR))
printk(KERN_CRIT DEV_LABEL "(itf %d): can't close RX channel " printk(KERN_CRIT DEV_LABEL "(itf %d): can't close RX channel "
"%d\n",vcc->dev->number,zatm_vcc->rx_chan); "%d\n",vcc->dev->number,zatm_vcc->rx_chan);
...@@ -699,7 +699,7 @@ printk("NONONONOO!!!!\n"); ...@@ -699,7 +699,7 @@ printk("NONONONOO!!!!\n");
skb_queue_tail(&zatm_vcc->tx_queue,skb); skb_queue_tail(&zatm_vcc->tx_queue,skb);
DPRINTK("QRP=0x%08lx\n",zpeekl(zatm_dev,zatm_vcc->tx_chan*VC_SIZE/4+ DPRINTK("QRP=0x%08lx\n",zpeekl(zatm_dev,zatm_vcc->tx_chan*VC_SIZE/4+
uPD98401_TXVC_QRP)); uPD98401_TXVC_QRP));
zwait; zwait();
zout(uPD98401_TX_READY | (zatm_vcc->tx_chan << zout(uPD98401_TX_READY | (zatm_vcc->tx_chan <<
uPD98401_CHAN_ADDR_SHIFT),CMR); uPD98401_CHAN_ADDR_SHIFT),CMR);
spin_unlock_irqrestore(&zatm_dev->lock, flags); spin_unlock_irqrestore(&zatm_dev->lock, flags);
...@@ -891,12 +891,12 @@ static void close_tx(struct atm_vcc *vcc) ...@@ -891,12 +891,12 @@ static void close_tx(struct atm_vcc *vcc)
} }
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
#if 0 #if 0
zwait; zwait();
zout(uPD98401_DEACT_CHAN | (chan << uPD98401_CHAN_ADDR_SHIFT),CMR); zout(uPD98401_DEACT_CHAN | (chan << uPD98401_CHAN_ADDR_SHIFT),CMR);
#endif #endif
zwait; zwait();
zout(uPD98401_CLOSE_CHAN | (chan << uPD98401_CHAN_ADDR_SHIFT),CMR); zout(uPD98401_CLOSE_CHAN | (chan << uPD98401_CHAN_ADDR_SHIFT),CMR);
zwait; zwait();
if (!(zin(CMR) & uPD98401_CHAN_ADDR)) if (!(zin(CMR) & uPD98401_CHAN_ADDR))
printk(KERN_CRIT DEV_LABEL "(itf %d): can't close TX channel " printk(KERN_CRIT DEV_LABEL "(itf %d): can't close TX channel "
"%d\n",vcc->dev->number,chan); "%d\n",vcc->dev->number,chan);
...@@ -926,9 +926,9 @@ static int open_tx_first(struct atm_vcc *vcc) ...@@ -926,9 +926,9 @@ static int open_tx_first(struct atm_vcc *vcc)
zatm_vcc->tx_chan = 0; zatm_vcc->tx_chan = 0;
if (vcc->qos.txtp.traffic_class == ATM_NONE) return 0; if (vcc->qos.txtp.traffic_class == ATM_NONE) return 0;
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
zwait; zwait();
zout(uPD98401_OPEN_CHAN,CMR); zout(uPD98401_OPEN_CHAN,CMR);
zwait; zwait();
DPRINTK("0x%x 0x%x\n",zin(CMR),zin(CER)); DPRINTK("0x%x 0x%x\n",zin(CMR),zin(CER));
chan = (zin(CMR) & uPD98401_CHAN_ADDR) >> uPD98401_CHAN_ADDR_SHIFT; chan = (zin(CMR) & uPD98401_CHAN_ADDR) >> uPD98401_CHAN_ADDR_SHIFT;
spin_unlock_irqrestore(&zatm_dev->lock, flags); spin_unlock_irqrestore(&zatm_dev->lock, flags);
...@@ -1557,7 +1557,7 @@ static void zatm_phy_put(struct atm_dev *dev,unsigned char value, ...@@ -1557,7 +1557,7 @@ static void zatm_phy_put(struct atm_dev *dev,unsigned char value,
struct zatm_dev *zatm_dev; struct zatm_dev *zatm_dev;
zatm_dev = ZATM_DEV(dev); zatm_dev = ZATM_DEV(dev);
zwait; zwait();
zout(value,CER); zout(value,CER);
zout(uPD98401_IND_ACC | uPD98401_IA_B0 | zout(uPD98401_IND_ACC | uPD98401_IA_B0 |
(uPD98401_IA_TGT_PHY << uPD98401_IA_TGT_SHIFT) | addr,CMR); (uPD98401_IA_TGT_PHY << uPD98401_IA_TGT_SHIFT) | addr,CMR);
...@@ -1569,10 +1569,10 @@ static unsigned char zatm_phy_get(struct atm_dev *dev,unsigned long addr) ...@@ -1569,10 +1569,10 @@ static unsigned char zatm_phy_get(struct atm_dev *dev,unsigned long addr)
struct zatm_dev *zatm_dev; struct zatm_dev *zatm_dev;
zatm_dev = ZATM_DEV(dev); zatm_dev = ZATM_DEV(dev);
zwait; zwait();
zout(uPD98401_IND_ACC | uPD98401_IA_B0 | uPD98401_IA_RW | zout(uPD98401_IND_ACC | uPD98401_IA_B0 | uPD98401_IA_RW |
(uPD98401_IA_TGT_PHY << uPD98401_IA_TGT_SHIFT) | addr,CMR); (uPD98401_IA_TGT_PHY << uPD98401_IA_TGT_SHIFT) | addr,CMR);
zwait; zwait();
return zin(CER) & 0xff; return zin(CER) & 0xff;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment