aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-04-11 19:00:00 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-12 14:21:30 -0400
commitd83d282bcbf24ec8ddd4f0eb57f7ad302c431b8a (patch)
treed70019b7c94d333c84ce3610186c8cff23b635d2
parentf344c25dbab1a392ef7a7afc8ca061b3b7285423 (diff)
s2io: Fix warnings due to -Wunused-but-set-variable.
Most of these are cases where we are trying to read back a register after a write to ensure completion. Simply pre-fixing the readl() or readq() with "(void)" is sufficient because these are volatile operations and the compiler cannot eliminate them just because no real assignment takes place. The case of free_rxd_blk()'s assignments to "struct buffAdd *ba" is a real spurious assignment as this variable is completely otherwise unused. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Jon Mason <jdmason@kudzu.us>
-rw-r--r--drivers/net/s2io.c5
-rw-r--r--drivers/net/s2io.h10
2 files changed, 5 insertions, 10 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index ca8e75e9a7ee..2d5cc6142c04 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2244,13 +2244,12 @@ static int verify_xena_quiescence(struct s2io_nic *sp)
2244static void fix_mac_address(struct s2io_nic *sp) 2244static void fix_mac_address(struct s2io_nic *sp)
2245{ 2245{
2246 struct XENA_dev_config __iomem *bar0 = sp->bar0; 2246 struct XENA_dev_config __iomem *bar0 = sp->bar0;
2247 u64 val64;
2248 int i = 0; 2247 int i = 0;
2249 2248
2250 while (fix_mac[i] != END_SIGN) { 2249 while (fix_mac[i] != END_SIGN) {
2251 writeq(fix_mac[i++], &bar0->gpio_control); 2250 writeq(fix_mac[i++], &bar0->gpio_control);
2252 udelay(10); 2251 udelay(10);
2253 val64 = readq(&bar0->gpio_control); 2252 (void) readq(&bar0->gpio_control);
2254 } 2253 }
2255} 2254}
2256 2255
@@ -2727,7 +2726,6 @@ static void free_rxd_blk(struct s2io_nic *sp, int ring_no, int blk)
2727 int j; 2726 int j;
2728 struct sk_buff *skb; 2727 struct sk_buff *skb;
2729 struct RxD_t *rxdp; 2728 struct RxD_t *rxdp;
2730 struct buffAdd *ba;
2731 struct RxD1 *rxdp1; 2729 struct RxD1 *rxdp1;
2732 struct RxD3 *rxdp3; 2730 struct RxD3 *rxdp3;
2733 struct mac_info *mac_control = &sp->mac_control; 2731 struct mac_info *mac_control = &sp->mac_control;
@@ -2751,7 +2749,6 @@ static void free_rxd_blk(struct s2io_nic *sp, int ring_no, int blk)
2751 memset(rxdp, 0, sizeof(struct RxD1)); 2749 memset(rxdp, 0, sizeof(struct RxD1));
2752 } else if (sp->rxd_mode == RXD_MODE_3B) { 2750 } else if (sp->rxd_mode == RXD_MODE_3B) {
2753 rxdp3 = (struct RxD3 *)rxdp; 2751 rxdp3 = (struct RxD3 *)rxdp;
2754 ba = &mac_control->rings[ring_no].ba[blk][j];
2755 pci_unmap_single(sp->pdev, 2752 pci_unmap_single(sp->pdev,
2756 (dma_addr_t)rxdp3->Buffer0_ptr, 2753 (dma_addr_t)rxdp3->Buffer0_ptr,
2757 BUF0_LEN, 2754 BUF0_LEN,
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index 628fd278866a..800b3a44e653 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -1002,18 +1002,16 @@ static inline void writeq(u64 val, void __iomem *addr)
1002#define LF 2 1002#define LF 2
1003static inline void SPECIAL_REG_WRITE(u64 val, void __iomem *addr, int order) 1003static inline void SPECIAL_REG_WRITE(u64 val, void __iomem *addr, int order)
1004{ 1004{
1005 u32 ret;
1006
1007 if (order == LF) { 1005 if (order == LF) {
1008 writel((u32) (val), addr); 1006 writel((u32) (val), addr);
1009 ret = readl(addr); 1007 (void) readl(addr);
1010 writel((u32) (val >> 32), (addr + 4)); 1008 writel((u32) (val >> 32), (addr + 4));
1011 ret = readl(addr + 4); 1009 (void) readl(addr + 4);
1012 } else { 1010 } else {
1013 writel((u32) (val >> 32), (addr + 4)); 1011 writel((u32) (val >> 32), (addr + 4));
1014 ret = readl(addr + 4); 1012 (void) readl(addr + 4);
1015 writel((u32) (val), addr); 1013 writel((u32) (val), addr);
1016 ret = readl(addr); 1014 (void) readl(addr);
1017 } 1015 }
1018} 1016}
1019 1017