mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper Juhl <juhl-lkml@dif.dk>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Karsten Keil <keil@isdn4linux.de>
Subject: [PATCH] readb/writeb pointer from integer without a cast fixes - correct way to fix?
Date: Mon, 20 Sep 2004 21:40:07 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0409202134100.2729@dragon.hygekrogen.localhost> (raw)


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);
 }




                 reply	other threads:[~2004-09-20 19:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0409202134100.2729@dragon.hygekrogen.localhost \
    --to=juhl-lkml@dif.dk \
    --cc=keil@isdn4linux.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®