mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix warnings on calls to P54P_READ() for which the result is discarded
@ 2008-07-11 14:14 David Howells
  2008-07-13  5:24 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2008-07-11 14:14 UTC (permalink / raw)
  To: flamingice, akpm; +Cc: dhowells, linville, netdev, linux-kernel

Fix warnings on calls to P54P_READ() for which the result is discarded because
the side-effect of accessing hardware is what's of interest, not the result of
performing the read.

The warnings are of the form:

drivers/net/wireless/p54/p54pci.c:55: warning: value computed is not used

Casting to (void) gets rid of this.

They were introduced in patch eff1a59c48e3c6a006eb4fe5f2e405a996f2259d.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 drivers/net/wireless/p54/p54pci.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)


diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index 7dd4add..47a3654 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -52,14 +52,14 @@ static int p54p_upload_firmware(struct ieee80211_hw *dev)
 	u32 remains, left, device_addr;
 
 	P54P_WRITE(int_enable, cpu_to_le32(0));
-	P54P_READ(int_enable);
+	(void) P54P_READ(int_enable);
 	udelay(10);
 
 	reg = P54P_READ(ctrl_stat);
 	reg &= cpu_to_le32(~ISL38XX_CTRL_STAT_RESET);
 	reg &= cpu_to_le32(~ISL38XX_CTRL_STAT_RAMBOOT);
 	P54P_WRITE(ctrl_stat, reg);
-	P54P_READ(ctrl_stat);
+	(void) P54P_READ(ctrl_stat);
 	udelay(10);
 
 	reg |= cpu_to_le32(ISL38XX_CTRL_STAT_RESET);
@@ -89,7 +89,7 @@ static int p54p_upload_firmware(struct ieee80211_hw *dev)
 		u32 i = 0;
 		left = min((u32)0x1000, remains);
 		P54P_WRITE(direct_mem_base, cpu_to_le32(device_addr));
-		P54P_READ(int_enable);
+		(void) P54P_READ(int_enable);
 
 		device_addr += 0x1000;
 		while (i < left) {
@@ -98,7 +98,7 @@ static int p54p_upload_firmware(struct ieee80211_hw *dev)
 		}
 
 		remains -= left;
-		P54P_READ(int_enable);
+		(void) P54P_READ(int_enable);
 	}
 
 	release_firmware(fw_entry);
@@ -108,7 +108,7 @@ static int p54p_upload_firmware(struct ieee80211_hw *dev)
 	reg &= cpu_to_le32(~ISL38XX_CTRL_STAT_RESET);
 	reg |= cpu_to_le32(ISL38XX_CTRL_STAT_RAMBOOT);
 	P54P_WRITE(ctrl_stat, reg);
-	P54P_READ(ctrl_stat);
+	(void) P54P_READ(ctrl_stat);
 	udelay(10);
 
 	reg |= cpu_to_le32(ISL38XX_CTRL_STAT_RESET);
@@ -167,11 +167,11 @@ static int p54p_read_eeprom(struct ieee80211_hw *dev)
 
 	memset(ring_control, 0, sizeof(*ring_control));
 	P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma));
-	P54P_READ(ring_control_base);
+	(void) P54P_READ(ring_control_base);
 	udelay(10);
 
 	P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_INIT));
-	P54P_READ(int_enable);
+	(void) P54P_READ(int_enable);
 	udelay(10);
 
 	P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET));
@@ -184,7 +184,7 @@ static int p54p_read_eeprom(struct ieee80211_hw *dev)
 	}
 
 	P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_UPDATE));
-	P54P_READ(int_enable);
+	(void) P54P_READ(int_enable);
 
 	hdr = eeprom + 0x2010;
 	p54_fill_eeprom_readback(hdr);
@@ -230,7 +230,7 @@ static int p54p_read_eeprom(struct ieee80211_hw *dev)
  out:
 	kfree(eeprom);
 	P54P_WRITE(int_enable, cpu_to_le32(0));
-	P54P_READ(int_enable);
+	(void) P54P_READ(int_enable);
 	udelay(10);
 	free_irq(priv->pdev->irq, priv);
 	P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET));
@@ -397,7 +397,7 @@ static void p54p_tx(struct ieee80211_hw *dev, struct p54_control_hdr *data,
 	spin_unlock_irqrestore(&priv->lock, flags);
 
 	P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE));
-	P54P_READ(dev_int);
+	(void) P54P_READ(dev_int);
 
 	/* FIXME: unlikely to happen because the device usually runs out of
 	   memory before we fill the ring up, but we can make it impossible */
@@ -426,17 +426,17 @@ static int p54p_open(struct ieee80211_hw *dev)
 	p54p_upload_firmware(dev);
 
 	P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma));
-	P54P_READ(ring_control_base);
+	(void) P54P_READ(ring_control_base);
 	wmb();
 	udelay(10);
 
 	P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_INIT));
-	P54P_READ(int_enable);
+	(void) P54P_READ(int_enable);
 	wmb();
 	udelay(10);
 
 	P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET));
-	P54P_READ(dev_int);
+	(void) P54P_READ(dev_int);
 
 	if (!wait_for_completion_interruptible_timeout(&priv->boot_comp, HZ)) {
 		printk(KERN_ERR "%s: Cannot boot firmware!\n",
@@ -446,12 +446,12 @@ static int p54p_open(struct ieee80211_hw *dev)
 	}
 
 	P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_UPDATE));
-	P54P_READ(int_enable);
+	(void) P54P_READ(int_enable);
 	wmb();
 	udelay(10);
 
 	P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE));
-	P54P_READ(dev_int);
+	(void) P54P_READ(dev_int);
 	wmb();
 	udelay(10);
 
@@ -466,7 +466,7 @@ static void p54p_stop(struct ieee80211_hw *dev)
 	struct p54p_desc *desc;
 
 	P54P_WRITE(int_enable, cpu_to_le32(0));
-	P54P_READ(int_enable);
+	(void) P54P_READ(int_enable);
 	udelay(10);
 
 	free_irq(priv->pdev->irq, dev);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix warnings on calls to P54P_READ() for which the result is discarded
  2008-07-11 14:14 [PATCH] Fix warnings on calls to P54P_READ() for which the result is discarded David Howells
@ 2008-07-13  5:24 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2008-07-13  5:24 UTC (permalink / raw)
  To: David Howells; +Cc: flamingice, linville, netdev, linux-kernel

On Fri, 11 Jul 2008 15:14:43 +0100 David Howells <dhowells@redhat.com> wrote:

> Fix warnings on calls to P54P_READ() for which the result is discarded because
> the side-effect of accessing hardware is what's of interest, not the result of
> performing the read.
> 
> The warnings are of the form:
> 
> drivers/net/wireless/p54/p54pci.c:55: warning: value computed is not used

hm, why aren't I seeing these?

> Casting to (void) gets rid of this.

This makes the ugly uglier.  Would it fix the warnings if we were to do

-#define P54P_READ(r) (__force __le32)__raw_readl(&priv->map->r)
+static inline __le32 p54p_read(__le32 *addr)
+{
+	return (__force __le32)__raw_readl(addr);
+}

...
-	P54P_READ(dev_int);
+	P54P_READ(&priv->map->dev_int);

or something along those lines?

Because the cpp trickery in there really isn't very nice.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-13  5:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-11 14:14 [PATCH] Fix warnings on calls to P54P_READ() for which the result is discarded David Howells
2008-07-13  5:24 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome