Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Nov 2004 23:30:08 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA97U1TX002474 for ; Mon, 8 Nov 2004 23:30:01 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CRQRi-00036s-Te; Tue, 09 Nov 2004 07:29:43 +0000 Message-ID: <419071D5.8070208@pobox.com> Date: Tue, 09 Nov 2004 02:29:25 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jouni Malinen 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} References: <20041108070156.GA1076@jm.kir.nu> <20041108071630.GK1076@jm.kir.nu> In-Reply-To: <20041108071630.GK1076@jm.kir.nu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11612 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 5636 Lines: 171 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 > > > 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 *