]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] added typechecking ot sparc64 ioremap()
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Thu, 21 Oct 2004 11:04:56 +0000 (04:04 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 21 Oct 2004 11:04:56 +0000 (04:04 -0700)
ioremap() made inlined function on sparc64; that had caught one bogosity in
drivers, actually - cpwatchdog.c passed sizeof(structure that was never
declared) as the second argument to ioremap().  It went unnoticed since
that argument was never used in the body of macro, so it disappeared without
a trace...

Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/sbus/char/cpwatchdog.c
include/asm-sparc64/io.h

index 9fcf180ba1a0ba763b6af4c618a9b86d3ade075b..b7b0c552bb746789984ab1709a2e847ceefca2ce 100644 (file)
@@ -743,7 +743,7 @@ ebus_done:
        }
 
        wd_dev.regs = 
-               ioremap(edev->resource[0].start, sizeof(struct wd_regblk));
+               ioremap(edev->resource[0].start, 4 * WD_TIMER_REGSZ); /* ? */
 
        if(NULL == wd_dev.regs) {
                printk("%s: unable to map registers\n", WD_OBPNAME);
index 2d6aa90f074d68ff4a5f898c08f23b4d7f8f1866..8c600b0603fff69e0a0e100332ba6d715c74dd9d 100644 (file)
@@ -444,9 +444,16 @@ out:
 /* On sparc64 we have the whole physical IO address space accessible
  * using physically addressed loads and stores, so this does nothing.
  */
-#define ioremap(__offset, __size)      ((void __iomem *)(__offset))
+static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
+{
+       return (void __iomem *)offset;
+}
+
 #define ioremap_nocache(X,Y)           ioremap((X),(Y))
-#define iounmap(__addr)                        do { (void)(__addr); } while(0)
+
+static inline void iounmap(void __iomem *addr)
+{
+}
 
 #define ioread8(X)                     readb(X)
 #define ioread16(X)                    readw(X)