netdev
[Top] [All Lists]

[PATCH] Fix readw/writew warnings in drivers/net/wireless/hermes.h

To: Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>
Subject: [PATCH] Fix readw/writew warnings in drivers/net/wireless/hermes.h
From: Cal Peake <cp@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 11 Oct 2004 07:34:00 -0400 (EDT)
Cc: NetDev Mailing List <netdev@xxxxxxxxxxx>, proski@xxxxxxx, hermes@xxxxxxxxxxxxxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
Hi,

This patch fixes several dozen warnings spit out when compiling the hermes 
wireless driver.

In file included from drivers/net/wireless/orinoco.c:448:
drivers/net/wireless/hermes.h: In function `hermes_present':
drivers/net/wireless/hermes.h:398: warning: passing arg 1 of `readw' makes 
pointer from integer without a cast
drivers/net/wireless/hermes.h: In function `hermes_set_irqmask':
drivers/net/wireless/hermes.h:404: warning: passing arg 2 of `writew' makes 
pointer from integer without a cast
...

thanks,

-- Cal


Signed-off-by: Cal Peake <cp@xxxxxxxxxxxxxxxxxxx>


diff -Nru linux-2.6.9-rc4/drivers/net/wireless/hermes.h 
linux-2.6.9-rc4-1/drivers/net/wireless/hermes.h
--- linux-2.6.9-rc4/drivers/net/wireless/hermes.h       2004-10-11 
02:38:38.000000000 -0400
+++ linux-2.6.9-rc4-1/drivers/net/wireless/hermes.h     2004-10-11 
06:56:01.000000000 -0400
@@ -364,12 +364,12 @@
 /* Register access convenience macros */
 #define hermes_read_reg(hw, off) ((hw)->io_space ? \
        inw((hw)->iobase + ( (off) << (hw)->reg_spacing )) : \
-       readw((hw)->iobase + ( (off) << (hw)->reg_spacing )))
+       readw((void __iomem *)(hw)->iobase + ( (off) << (hw)->reg_spacing )))
 #define hermes_write_reg(hw, off, val) do { \
        if ((hw)->io_space) \
                outw_p((val), (hw)->iobase + ((off) << (hw)->reg_spacing)); \
        else \
-               writew((val), (hw)->iobase + ((off) << (hw)->reg_spacing)); \
+               writew((val), (void __iomem *)(hw)->iobase + ((off) << 
(hw)->reg_spacing)); \
        } while (0)
 #define hermes_read_regn(hw, name) hermes_read_reg((hw), HERMES_##name)
 #define hermes_write_regn(hw, name, val) hermes_write_reg((hw), HERMES_##name, 
(val))
@@ -442,7 +442,7 @@
                 * gcc is smart enough to fold away the two swaps on
                 * big-endian platforms. */
                for (i = 0, p = buf; i < count; i++) {
-                       *p++ = cpu_to_le16(readw(hw->iobase + off));
+                       *p++ = cpu_to_le16(readw((void __iomem *)hw->iobase + 
off));
                }
        }
 }
@@ -462,7 +462,7 @@
                 * hope gcc is smart enough to fold away the two swaps
                 * on big-endian platforms. */
                for (i = 0, p = buf; i < count; i++) {
-                       writew(le16_to_cpu(*p++), hw->iobase + off);
+                       writew(le16_to_cpu(*p++), (void __iomem *)hw->iobase + 
off);
                }
        }
 }
@@ -478,7 +478,7 @@
                        outw(0, hw->iobase + off);
        } else {
                for (i = 0; i < count; i++)
-                       writew(0, hw->iobase + off);
+                       writew(0, (void __iomem *)hw->iobase + off);
        }
 }
 

<Prev in Thread] Current Thread [Next in Thread>