Re: [PATCH] Fix warnings on calls to P54P_READ() for which theresult is discarded
From: Andrew Morton
Date: Sun Jul 13 2008 - 01:26:24 EST
On Fri, 11 Jul 2008 15:14:43 +0100 David Howells <dhowells@xxxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/