From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: akpm@osdl.org, linux-kernel@vger.kernel.org,
linux-wireless@vger.kernel.org
Subject: [PATCH] prism54usb: Fix hail of warnings on 64bit platforms
Date: Wed, 7 Mar 2007 16:40:20 +0000 [thread overview]
Message-ID: <20070307164020.16944e32@lxorguk.ukuu.org.uk> (raw)
If you want to cast a pointer to a small value then start by turning it
into an unsigned long so the compiler knows what is going on.
Personally I find the whole approach used by this driver for types of
registers (which are really USB register numbers) utterly perverse...
Signed-off-by: Alan Cox <alan@redhat.com>
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc2-mm2/drivers/net/wireless/mac80211/p54/prism54usb.c linux-2.6.21-rc2-mm2/drivers/net/wireless/mac80211/p54/prism54usb.c
--- linux.vanilla-2.6.21-rc2-mm2/drivers/net/wireless/mac80211/p54/prism54usb.c 2007-03-06 23:09:47.000000000 +0000
+++ linux-2.6.21-rc2-mm2/drivers/net/wireless/mac80211/p54/prism54usb.c 2007-03-06 19:15:52.000000000 +0000
@@ -533,7 +533,7 @@
#define P54U_WRITE(type, addr, data) \
do {\
err = p54u_write(priv, buf, type,\
- cpu_to_le32((u32)addr), data);\
+ cpu_to_le32((u32)(unsigned long)addr), data);\
if (err) \
goto fail;\
} while (0)
@@ -541,7 +541,7 @@
#define P54U_READ(type, addr) \
do {\
err = p54u_read(priv, buf, type,\
- cpu_to_le32((u32)addr), ®);\
+ cpu_to_le32((u32)(unsigned long)addr), ®);\
if (err)\
goto fail;\
} while (0)
@@ -648,16 +648,16 @@
cpu_to_le32(0xc0000f00));
P54U_WRITE(NET2280_DEV_U32,
- 0x0020 | (u32)&devreg->direct_mem_win, 0);
+ 0x0020 | (unsigned long)&devreg->direct_mem_win, 0);
P54U_WRITE(NET2280_DEV_U32,
- 0x0020 | (u32)&devreg->direct_mem_win,
+ 0x0020 | (unsigned long)&devreg->direct_mem_win,
cpu_to_le32(1));
P54U_WRITE(NET2280_DEV_U32,
- 0x0024 | (u32)&devreg->direct_mem_win,
+ 0x0024 | (unsigned long)&devreg->direct_mem_win,
cpu_to_le32(block_len));
P54U_WRITE(NET2280_DEV_U32,
- 0x0028 | (u32)&devreg->direct_mem_win,
+ 0x0028 | (unsigned long)&devreg->direct_mem_win,
cpu_to_le32(offset));
P54U_WRITE(NET2280_DEV_U32, &devreg->dma_addr,
@@ -670,7 +670,7 @@
mdelay(10);
P54U_READ(NET2280_DEV_U32,
- 0x002C | (u32)&devreg->direct_mem_win);
+ 0x002C | (unsigned long)&devreg->direct_mem_win);
if (!(reg & cpu_to_le32(ISL38XX_DMA_STATUS_DONE)) ||
!(reg & cpu_to_le32(ISL38XX_DMA_STATUS_READY))) {
printk(KERN_ERR "prism54usb: firmware DMA transfer "
next reply other threads:[~2007-03-07 15:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-07 16:40 Alan Cox [this message]
2007-03-07 15:42 ` Mark Lord
2007-03-07 17:00 ` Alan Cox
2007-03-07 17:21 ` Michael Wu
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=20070307164020.16944e32@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@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®