2012-05-22 01:11:21

by Hartley Sweeten

[permalink] [raw]
Subject: [PATCH] staging: comedi: ii_pci20kc: iobase and ioaddr are void __iomem *

The iobase variables in struct pci20xxx_subdev_private and ioaddr
variable in struct pci20xxx_private should be void __iomem * not
void *.

This quiets a lot of sparse warings for the writeb and readb calls
like:

warning: incorrect type in argument 1 (different address spaces)
   expected void const volatile [noderef] <asn:2>*addr
   got void *<noident>

warning: incorrect type in argument 2 (different address spaces)
   expected void volatile [noderef] <asn:2>*addr
   got void *

Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: Ian Abbott <[email protected]>
Cc: Mori Hess <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>

---

diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c
index f0a579a..6f69476 100644
--- a/drivers/staging/comedi/drivers/ii_pci20kc.c
+++ b/drivers/staging/comedi/drivers/ii_pci20kc.c
@@ -135,15 +135,15 @@ options for PCI-20341M:
#define PCI20341_SCANLIST 0x80 /* Channel/Gain Scan List */

union pci20xxx_subdev_private {
- void *iobase;
+ void __iomem *iobase;
struct {
- void *iobase;
+ void __iomem *iobase;
const struct comedi_lrange *ao_range_list[2];
/* range of channels of ao module */
unsigned int last_data[2];
} pci20006;
struct {
- void *iobase;
+ void __iomem *iobase;
int timebase;
int settling_time;
int ai_gain;
@@ -152,7 +152,7 @@ union pci20xxx_subdev_private {

struct pci20xxx_private {

- void *ioaddr;
+ void __iomem *ioaddr;
union pci20xxx_subdev_private subdev_private[PCI20000_MODULES];
};

@@ -210,7 +210,7 @@ static int pci20xxx_attach(struct comedi_device *dev,
if (ret < 0)
return ret;

- devpriv->ioaddr = (void *)(unsigned long)it->options[0];
+ devpriv->ioaddr = (void __iomem *)(unsigned long)it->options[0];
dev->board_name = "pci20kc";

/* Check PCI-20001 C-2A Carrier Board ID */


2012-05-22 08:08:17

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH] staging: comedi: ii_pci20kc: iobase and ioaddr are void __iomem *

On Mon, May 21, 2012 at 06:10:07PM -0700, H Hartley Sweeten wrote:
> @@ -210,7 +210,7 @@ static int pci20xxx_attach(struct comedi_device *dev,
> if (ret < 0)
> return ret;
>
> - devpriv->ioaddr = (void *)(unsigned long)it->options[0];
> + devpriv->ioaddr = (void __iomem *)(unsigned long)it->options[0];


Obviously, your patch is fine, but I was wondering if it was a
problem that it->options was only a 32 bit? Seems like it would
deserve a comment.

regards,
dan carpenter

2012-05-22 10:15:18

by Ian Abbott

[permalink] [raw]
Subject: Re: [PATCH] staging: comedi: ii_pci20kc: iobase and ioaddr are void __iomem *

On 2012-05-22 09:11, Dan Carpenter wrote:
> On Mon, May 21, 2012 at 06:10:07PM -0700, H Hartley Sweeten wrote:
>> @@ -210,7 +210,7 @@ static int pci20xxx_attach(struct comedi_device *dev,
>> if (ret< 0)
>> return ret;
>>
>> - devpriv->ioaddr = (void *)(unsigned long)it->options[0];
>> + devpriv->ioaddr = (void __iomem *)(unsigned long)it->options[0];
>
>
> Obviously, your patch is fine, but I was wondering if it was a
> problem that it->options was only a 32 bit? Seems like it would
> deserve a comment.

Yes, it's a bit of a strange driver, this one. It's a driver for a
module sitting on a PCI card, but there is no driver I know of for the
PCI card, and I've no idea what's actually ioremap'ing the memory!

Maybe we should quietly drop it and see if anyone complains?

--
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-

2012-06-05 06:15:48

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging: comedi: ii_pci20kc: iobase and ioaddr are void __iomem *

On Tue, May 22, 2012 at 11:15:12AM +0100, Ian Abbott wrote:
> On 2012-05-22 09:11, Dan Carpenter wrote:
> >On Mon, May 21, 2012 at 06:10:07PM -0700, H Hartley Sweeten wrote:
> >>@@ -210,7 +210,7 @@ static int pci20xxx_attach(struct comedi_device *dev,
> >> if (ret< 0)
> >> return ret;
> >>
> >>- devpriv->ioaddr = (void *)(unsigned long)it->options[0];
> >>+ devpriv->ioaddr = (void __iomem *)(unsigned long)it->options[0];
> >
> >
> >Obviously, your patch is fine, but I was wondering if it was a
> >problem that it->options was only a 32 bit? Seems like it would
> >deserve a comment.
>
> Yes, it's a bit of a strange driver, this one. It's a driver for a
> module sitting on a PCI card, but there is no driver I know of for
> the PCI card, and I've no idea what's actually ioremap'ing the
> memory!
>
> Maybe we should quietly drop it and see if anyone complains?

I'm all for deleting code :)

Send me a patch removing it and I'll be glad to apply it.

thanks,

greg k-h