From: Jeff Garzik <jgarzik@pobox•com>
To: Jouni Malinen <jkmaline@cc•hut.fi>
Cc: netdev@oss•sgi.com
Subject: Re: [PATCH wireless-2.6 10/12] Host AP: Use void * instead of unsigned long with {read,write}{b,w}
Date: Tue, 09 Nov 2004 02:29:25 -0500 [thread overview]
Message-ID: <419071D5.8070208@pobox.com> (raw)
In-Reply-To: <20041108071630.GK1076@jm.kir.nu>
Jouni Malinen wrote:
> Start using void * instead of unsigned long with {read,write}{b,w} to
> silence compiler warning with Linux 2.6.9-rc2.
>
> Signed-off-by: Jouni Malinen <jkmaline@cc•hut.fi>
>
>
> diff -Nru a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
> --- a/drivers/net/wireless/hostap/hostap_pci.c 2004-11-07 22:39:06 -08:00
> +++ b/drivers/net/wireless/hostap/hostap_pci.c 2004-11-07 22:39:06 -08:00
> @@ -56,7 +56,7 @@
>
> spin_lock_irqsave(&local->lock, flags);
> prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v);
> - writeb(v, dev->mem_start + a);
> + writeb(v, (void *) dev->mem_start + a);
> spin_unlock_irqrestore(&local->lock, flags);
> }
>
> @@ -68,7 +68,7 @@
> u8 v;
>
> spin_lock_irqsave(&local->lock, flags);
> - v = readb(dev->mem_start + a);
> + v = readb((void *) dev->mem_start + a);
> prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v);
> spin_unlock_irqrestore(&local->lock, flags);
> return v;
> @@ -82,7 +82,7 @@
>
> spin_lock_irqsave(&local->lock, flags);
> prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v);
> - writew(v, dev->mem_start + a);
> + writew(v, (void *) dev->mem_start + a);
> spin_unlock_irqrestore(&local->lock, flags);
> }
>
> @@ -94,7 +94,7 @@
> u16 v;
>
> spin_lock_irqsave(&local->lock, flags);
> - v = readw(dev->mem_start + a);
> + v = readw((void *) dev->mem_start + a);
> prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v);
> spin_unlock_irqrestore(&local->lock, flags);
> return v;
> @@ -109,12 +109,14 @@
>
> #else /* PRISM2_IO_DEBUG */
>
> -#define HFA384X_OUTB(v,a) writeb((v), dev->mem_start + (a))
> -#define HFA384X_INB(a) (u8) readb(dev->mem_start + (a))
> -#define HFA384X_OUTW(v,a) writew((v), dev->mem_start + (a))
> -#define HFA384X_INW(a) (u16) readw(dev->mem_start + (a))
> -#define HFA384X_OUTW_DATA(v,a) writew(cpu_to_le16(v), dev->mem_start + (a))
> -#define HFA384X_INW_DATA(a) (u16) le16_to_cpu(readw(dev->mem_start + (a)))
> +#define HFA384X_OUTB(v,a) writeb((v), (void *) dev->mem_start + (a))
> +#define HFA384X_INB(a) (u8) readb((void *) dev->mem_start + (a))
> +#define HFA384X_OUTW(v,a) writew((v), (void *) dev->mem_start + (a))
> +#define HFA384X_INW(a) (u16) readw((void *) dev->mem_start + (a))
> +#define HFA384X_OUTW_DATA(v,a) \
> + writew(cpu_to_le16(v), (void *) dev->mem_start + (a))
> +#define HFA384X_INW_DATA(a) (u16) \
> + le16_to_cpu(readw((void *) dev->mem_start + (a)))
Two comments:
1) that should be "void __iomem *" not "void *" for MMIO memory pointers
2) don't bother using dev->mem_start, that is normally used for passing
options or an ISA memory address from userland to the kernel. Store the
result of ioremap() in a private 'void __iomem *' pointer instead.
> diff -Nru a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
> --- a/drivers/net/wireless/hostap/hostap_plx.c 2004-11-07 22:39:06 -08:00
> +++ b/drivers/net/wireless/hostap/hostap_plx.c 2004-11-07 22:39:06 -08:00
> @@ -247,7 +247,7 @@
>
> /* Set sreset bit of COR and clear it after hold time */
>
> - if (local->attr_mem == 0) {
> + if (local->attr_mem == NULL) {
> /* TMD7160 - COR at card's first I/O addr */
> corsave = inb(local->cor_offset);
> outb(corsave | COR_SRESET, local->cor_offset);
> @@ -271,7 +271,7 @@
> {
> unsigned char corsave;
>
> - if (local->attr_mem == 0) {
> + if (local->attr_mem == NULL) {
> /* TMD7160 - COR at card's first I/O addr */
> corsave = inb(local->cor_offset);
> outb(corsave | COR_SRESET, local->cor_offset);
> @@ -306,7 +306,7 @@
> };
>
>
> -static int prism2_plx_check_cis(unsigned long attr_mem, int attr_len,
> +static int prism2_plx_check_cis(void *attr_mem, int attr_len,
> unsigned int *cor_offset,
> unsigned int *cor_index)
> {
> @@ -401,7 +401,7 @@
> unsigned int pccard_ioaddr, plx_ioaddr;
> unsigned long pccard_attr_mem;
> unsigned int pccard_attr_len;
> - unsigned long attr_mem = 0;
> + void *attr_mem = NULL;
> unsigned int cor_offset, cor_index;
> u32 reg;
> local_info_t *local = NULL;
void __iomem *
> @@ -422,7 +422,7 @@
>
> if (tmd7160) {
> /* TMD7160 */
> - attr_mem = 0; /* no access to PC Card attribute memory */
> + attr_mem = NULL; /* no access to PC Card attribute memory */
>
> printk(KERN_INFO "TMD7160 PCI/PCMCIA adapter: io=0x%x, "
> "irq=%d, pccard_io=0x%x\n",
> @@ -448,9 +448,8 @@
> goto fail;
>
>
> - attr_mem = (unsigned long) ioremap(pccard_attr_mem,
> - pccard_attr_len);
> - if (!attr_mem) {
> + attr_mem = ioremap(pccard_attr_mem, pccard_attr_len);
> + if (attr_mem == NULL) {
> printk(KERN_ERR "%s: cannot remap attr_mem\n",
> dev_info);
> goto fail;
> @@ -532,7 +531,7 @@
> free_irq(dev->irq, dev);
>
> if (attr_mem)
> - iounmap((void *) attr_mem);
> + iounmap(attr_mem);
>
> pci_disable_device(pdev);
>
> @@ -550,7 +549,7 @@
> hfa384x_disable_interrupts(dev);
>
> if (iface->local->attr_mem)
> - iounmap((void *) iface->local->attr_mem);
> + iounmap(iface->local->attr_mem);
> if (dev->irq)
> free_irq(dev->irq, dev);
>
> diff -Nru a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
> --- a/drivers/net/wireless/hostap/hostap_wlan.h 2004-11-07 22:39:06 -08:00
> +++ b/drivers/net/wireless/hostap/hostap_wlan.h 2004-11-07 22:39:06 -08:00
> @@ -895,7 +895,7 @@
> #endif /* PRISM2_PCCARD */
>
> #ifdef PRISM2_PLX
> - unsigned long attr_mem;
> + void *attr_mem;
> unsigned int cor_offset;
> #endif /* PRISM2_PLX */
void __iomem *
next prev parent reply other threads:[~2004-11-09 7:29 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-08 7:01 [PATCH wireless-2.6 0/12] Host AP update Jouni Malinen
2004-11-08 7:10 ` [PATCH wireless-2.6 1/12] Host AP: Disable EAPOL TX/RX debug messages Jouni Malinen
2004-11-09 7:40 ` Jeff Garzik
2004-11-08 7:11 ` [PATCH wireless-2.6 2/12] Host AP: Fix interface packet counters Jouni Malinen
2004-11-08 7:12 ` [PATCH wireless-2.6 3/12] Host AP: Ignore (Re)AssocResp messages silently Jouni Malinen
2004-11-08 7:12 ` [PATCH wireless-2.6 4/12] Host AP: Remove ioctl debug messages Jouni Malinen
2004-11-08 7:13 ` [PATCH wireless-2.6 5/12] Host AP: Fix hw address changing for wifi# interface Jouni Malinen
2004-11-08 7:13 ` [PATCH wireless-2.6 6/12] Host AP: Prevent STAs from associating using AP address Jouni Malinen
2004-11-08 7:14 ` [PATCH wireless-2.6 7/12] Host AP: Fix compilation with PRISM2_NO_STATION_MODES defined Jouni Malinen
2004-11-08 7:14 ` [PATCH wireless-2.6 8/12] Host AP: Do not bridge packets to unauthorized ports Jouni Malinen
2004-11-08 7:15 ` [PATCH wireless-2.6 9/12] Host AP: Fix card enabling after firmware download Jouni Malinen
2004-11-08 7:16 ` [PATCH wireless-2.6 10/12] Host AP: Use void * instead of unsigned long with {read,write}{b,w} Jouni Malinen
2004-11-09 7:29 ` Jeff Garzik [this message]
2004-11-14 5:18 ` [PATCH wireless-2.6 10/16] Host AP: Use void __iomem * " Jouni Malinen
2004-11-14 23:49 ` Jeff Garzik
2004-11-08 7:17 ` [PATCH wireless-2.6 11/12] Host AP: Fix PRISM2_IO_DEBUG Jouni Malinen
2004-11-09 7:29 ` Jeff Garzik
2004-11-14 5:20 ` [PATCH wireless-2.6 11/16] " Jouni Malinen
2004-11-08 7:17 ` [PATCH wireless-2.6 12/12] Host AP: Fix netif_carrier_off() in non-client modes Jouni Malinen
2004-11-09 8:04 ` [PATCH wireless-2.6 0/12] Host AP update Jeff Garzik
2004-11-09 9:09 ` Michael Renzmann
2004-11-09 15:26 ` Jeff Garzik
2004-11-09 21:32 ` Vladimir Kondratiev
2004-11-14 5:15 ` Jouni Malinen
2004-11-14 5:21 ` [PATCH wireless-2.6 12/16] Host AP: Fix netif_carrier_off() in non-client modes Jouni Malinen
2004-11-14 5:22 ` [PATCH wireless-2.6 13/16] Host AP: pci_register_driver() return value changes Jouni Malinen
2004-11-14 5:23 ` [PATCH wireless-2.6 14/16] Host AP: Updated to use Linux wireless extensions v17 Jouni Malinen
2004-11-14 5:24 ` [PATCH wireless-2.6 15/16] Host AP: Replaced direct dev->priv references with netdev_priv(dev) Jouni Malinen
2004-11-14 5:25 ` [PATCH wireless-2.6 16/16] Host AP: Replaced MODULE_PARM with module_param* Jouni Malinen
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=419071D5.8070208@pobox.com \
--to=jgarzik@pobox$(echo .)com \
--cc=jkmaline@cc$(echo .)hut.fi \
--cc=netdev@oss$(echo .)sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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