From: Bryan Batten <BryanBatten@compuserve.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Pavel Roskin <proski@gnu.org>,
David Gibson <hermes@gibson.dropbear.id.au>,
Trivial Patch Monkey <trivial@rustcorp.com.au>,
linux-kernel@vger.kernel.org
Subject: Warning Fix drivers/net/wireless in Kernel 2.6.9
Date: Wed, 10 Nov 2004 12:51:43 -0800 [thread overview]
Message-ID: <41927F5F.4080204@compuserve.com> (raw)
The patch removes the "makes pointer from integer without a cast"
warnings in orinoco code by casting the appropriate parameter to
readw, writew as (void *) in the header file hermes.h.
The underlying problem is that readw/writes boil down to low level
calls that take a pointer, while inw/outw boil down (eventually) to
low level calls that take an int. So the choice was to either cast
inw, outw parameters as (int)'s, or cast readw, writew parameters as
(void *). I chose the latter.
I suspect the truly "best" fix would be to change the underlying
inx/outx definitions to accept a pointer, so's to be consistent
with the definitions of readx/writex, but that would probably break
other stuff.
Anyway, here's the patch to hermes.h:
--- ./linux-2.6.9orig/drivers/net/wireless/hermes.h Thu Nov 4 11:33:23 2004
+++ ./linux-2.6/drivers/net/wireless/hermes.h Wed Nov 10 09:35:55 2004
@@ -364,12 +364,12 @@ typedef struct hermes {
/* 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 *)(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 *)(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 @@ static inline void hermes_read_words(str
* 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 *)hw->iobase + off));
}
}
}
@@ -462,7 +462,7 @@ static inline void hermes_write_words(st
* 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 *)hw->iobase + off);
}
}
}
@@ -478,7 +478,7 @@ static inline void hermes_clear_words(st
outw(0, hw->iobase + off);
} else {
for (i = 0; i < count; i++)
- writew(0, hw->iobase + off);
+ writew(0, (void *)hw->iobase + off);
}
}
next reply other threads:[~2004-11-10 21:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-10 20:51 Bryan Batten [this message]
2004-11-10 23:48 ` Warning Fix drivers/net/wireless in Kernel 2.6.9 David Gibson
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=41927F5F.4080204@compuserve.com \
--to=bryanbatten@compuserve.com \
--cc=hermes@gibson.dropbear.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=proski@gnu.org \
--cc=trivial@rustcorp.com.au \
/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