mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] readb/writeb pointer from integer without a cast fixes - correct way to fix?
@ 2004-09-20 19:40 Jesper Juhl
  0 siblings, 0 replies; only message in thread
From: Jesper Juhl @ 2004-09-20 19:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Karsten Keil


Hi, here's a patch attempting to fix the following warnings :

  CC      drivers/isdn/hisax/teles0.o
drivers/isdn/hisax/teles0.c: In function `readisac':
drivers/isdn/hisax/teles0.c:35: warning: passing arg 1 of `readb' makes pointer from integer without a cast
drivers/isdn/hisax/teles0.c: In function `writeisac':
drivers/isdn/hisax/teles0.c:41: warning: passing arg 2 of `writeb' makes pointer from integer without a cast
drivers/isdn/hisax/teles0.c: In function `readhscx':
drivers/isdn/hisax/teles0.c:49: warning: passing arg 1 of `readb' makes pointer from integer without a cast
drivers/isdn/hisax/teles0.c: In function `writehscx':
drivers/isdn/hisax/teles0.c:56: warning: passing arg 2 of `writeb' makes pointer from integer without a cast
drivers/isdn/hisax/teles0.c: In function `reset_teles0':
drivers/isdn/hisax/teles0.c:236: warning: passing arg 2 of `writeb' makes pointer from integer without a cast
drivers/isdn/hisax/teles0.c:238: warning: passing arg 2 of `writeb' makes pointer from integer without a cast

I hope I got it right. It builds fine, but I don't have the hardware to 
test and I would like some confirmation that this is the correct way to 
fix these warnings before I get started on the rest of them.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>


diff -up linux-2.6.9-rc2-bk5-orig/drivers/isdn/hisax/teles0.c linux-2.6.9-rc2-bk5/drivers/isdn/hisax/teles0.c
--- linux-2.6.9-rc2-bk5-orig/drivers/isdn/hisax/teles0.c	2004-08-14 07:36:58.000000000 +0200
+++ linux-2.6.9-rc2-bk5/drivers/isdn/hisax/teles0.c	2004-09-20 21:33:05.000000000 +0200
@@ -32,28 +32,28 @@ const char *teles0_revision = "$Revision
 static inline u_char
 readisac(unsigned long adr, u_char off)
 {
-	return readb(adr + ((off & 1) ? 0x2ff : 0x100) + off);
+	return readb((u_char *)(adr + ((off & 1) ? 0x2ff : 0x100) + off));
 }
 
 static inline void
 writeisac(unsigned long adr, u_char off, u_char data)
 {
-	writeb(data, adr + ((off & 1) ? 0x2ff : 0x100) + off); mb();
+	writeb(data, (u_char *)(adr + ((off & 1) ? 0x2ff : 0x100) + off)); mb();
 }
 
 
 static inline u_char
 readhscx(unsigned long adr, int hscx, u_char off)
 {
-	return readb(adr + (hscx ? 0x1c0 : 0x180) +
-		     ((off & 1) ? 0x1ff : 0) + off);
+	return readb((u_char *)(adr + (hscx ? 0x1c0 : 0x180) +
+		     ((off & 1) ? 0x1ff : 0) + off));
 }
 
 static inline void
 writehscx(unsigned long adr, int hscx, u_char off, u_char data)
 {
-	writeb(data, adr + (hscx ? 0x1c0 : 0x180) +
-	       ((off & 1) ? 0x1ff : 0) + off); mb();
+	writeb(data, (u_char *)(adr + (hscx ? 0x1c0 : 0x180) +
+	       ((off & 1) ? 0x1ff : 0) + off)); mb();
 }
 
 static inline void
@@ -233,9 +233,9 @@ reset_teles0(struct IsdnCardState *cs)
 		byteout(cs->hw.teles0.cfg_reg + 4, cfval | 1);
 		HZDELAY(HZ / 10 + 1);
 	}
-	writeb(0, cs->hw.teles0.membase + 0x80); mb();
+	writeb(0, (unsigned long *)(cs->hw.teles0.membase + 0x80)); mb();
 	HZDELAY(HZ / 5 + 1);
-	writeb(1, cs->hw.teles0.membase + 0x80); mb();
+	writeb(1, (unsigned long *)(cs->hw.teles0.membase + 0x80)); mb();
 	HZDELAY(HZ / 5 + 1);
 	return(0);
 }




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-09-20 19:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-20 19:40 [PATCH] readb/writeb pointer from integer without a cast fixes - correct way to fix? Jesper Juhl

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

all inboxes | Powered by JetHome®