matrox w1: fix integer to pointer conversion warnings
PATCH 1/1 matrox w1: fix integer to pointer conversion warnings
Get rid of some pointer to integer conversion warnings in the matrox w1 bus driver.
drivers/w1/matrox_w1.c +5 -5
@@ -78,11 +78,12 @@struct matrox_device { -unsigned long base_addr; -unsigned long port_index, port_data; +char *base_addr; +char *port_index, *port_data;u8 data_mask; -unsigned long phys_addr, virt_addr; +unsigned long phys_addr; +char *virt_addr;unsigned long found;struct w1_bus_master *bus_master;
@@ -181,8 +182,7 @@ dev->phys_addr =pci_resource_start (pdev,1 ); - dev->virt_addr = - (unsigned long )ioremap_nocache (dev->phys_addr,16384 ); + dev->virt_addr =ioremap_nocache (dev->phys_addr,16384 );if (!dev->virt_addr) {dev_err (&pdev->dev,"%s: failed to ioremap(0x%lx, %d).\n" , __func__, dev->phys_addr,16384 );
Quoted 2 lines · On Sun, 14 Nov 2004 13:07:08 +0100 Jan Dittmer <[email protected]> wrote:
Get rid of some pointer to integer conversion warnings in the matrox w1 bus driver.
I believe it should be done using __iomem * conversation. I will create a patch later.
Thank you.
Quoted 22 lines
Signed-off-by Jan Dittmer <[email protected]>diff -Nru
a/drivers/w1/matrox_w1.cb/drivers/w1/matrox_w1.cdrivers/w1/matrox_w1.c +4
-3@@ -78,11 +78,12 @@struct matrox_device { -unsigned long base_addr; -unsigned long port_index, port_data; +char *base_addr; +char *port_index, *port_data;u8 data_mask; -unsigned long phys_addr, virt_addr; +unsigned long phys_addr; +char *virt_addr;unsigned long found;struct w1_bus_master *bus_master;
drivers/w1/matrox_w1.c line 188
Quoted 9 lines
drivers/w1/matrox_w1.c +1
-2@@ -181,8 +182,7 @@ dev->phys_addr =pci_resource_start (pdev,1 ); - dev->virt_addr = - (unsigned long )ioremap_nocache (dev->phys_addr,16384 ); + dev->virt_addr =ioremap_nocache (dev->phys_addr,16384 );if (!dev->virt_addr) {dev_err (&pdev->dev,"%s: failed to ioremap(0x%lx, %d).\n" , __func__, dev->phys_addr,16384 );
Evgeniy Polyakov
Only failure makes us experts. -- Theo de Raadt
Quoted 7 lines · Evgeniy Polyakov
Quoted 2 lines · On Sun, 14 Nov 2004 13:07:08 +0100 Jan Dittmer <[email protected]> wrote:
Get rid of some pointer to integer conversion warnings in the matrox w1 bus driver.
You mean like this? (Incremental to the other one)
Jan
===== matrox_w1.c 1.4 vs edited =====
matrox_w1.c renamed from drivers/w1/matrox_w1.c +4 -4
@@ -78,12 +78,12 @@struct matrox_device { -char *base_addr; -char *port_index, *port_data; +char __iomem *base_addr; +char __iomem *port_index, *port_data;u8 data_mask;unsigned long phys_addr; -char *virt_addr; +char __iomem *virt_addr;unsigned long found;struct w1_bus_master *bus_master;
@@ -227,7 +227,7 @@if (dev->found) {w1_remove_master_device (dev->bus_master); -iounmap ((void *) dev->virt_addr); +iounmap (dev->virt_addr); }kfree (dev); }
Quoted 10 lines · Jan Dittmer
Quoted 7 lines · Evgeniy Polyakov
Quoted 2 lines · On Sun, 14 Nov 2004 13:07:08 +0100 Jan Dittmer <[email protected]> wrote:
Get rid of some pointer to integer conversion warnings in the matrox w1 bus driver.
You mean like this? (Incremental to the other one)
We should not treat __iomem suffix like just addition for variable declaration, it is now part of the type I think.
So there is no char __iomem, but only void __iomem.
Quoted 32 lines
Jan
______________________________________________________________________
=====matrox_w1.c1.4 vs edited =====matrox_w1.c renamed from drivers/w1/matrox_w1.c +4
-4@@ -78,12 +78,12 @@struct matrox_device { -char *base_addr; -char *port_index, *port_data; +char __iomem *base_addr; +char __iomem *port_index, *port_data;u8 data_mask;unsigned long phys_addr; -char *virt_addr; +char __iomem *virt_addr;unsigned long found;struct w1_bus_master *bus_master;@@ -227,7 +227,7 @@if (dev->found) {w1_remove_master_device (dev->bus_master); -iounmap ((void *) dev->virt_addr); +iounmap (dev->virt_addr); }kfree (dev); }
Signature · 3 lines
Evgeniy Polyakov Crash is better than data corruption. -- Art Grabowski
Evgeniy> So there is no char __iomem, but only void __iomem.
Declaring a pointer as "char __iomem *" is a perfectly good thing to do. __iomem is a type attribute and can be added to just about any base type.
- Roland