]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: gpib: Use __iomem attribute for io addresses
authorDave Penkler <dpenkler@gmail.com>
Tue, 14 Jan 2025 16:54:00 +0000 (17:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jan 2025 17:35:56 +0000 (18:35 +0100)
In a number of drivers the PCI memory pointers were declared simply as
void *.
This caused sparse to emit the following warning, for example:

agilent_82350b/agilent_82350b.c:44:58: warning: incorrect type in argument 2 (different address spaces)
agilent_82350b/agilent_82350b.c:44:58:    expected void volatile [noderef] __iomem *addr

Declare the PCI memory pointers as void __iomem *addr.

Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20250114165403.16410-2-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/agilent_82350b/agilent_82350b.c
drivers/staging/gpib/agilent_82350b/agilent_82350b.h
drivers/staging/gpib/eastwood/fluke_gpib.h
drivers/staging/gpib/fmh_gpib/fmh_gpib.h
drivers/staging/gpib/ines/ines_gpib.c
drivers/staging/gpib/tnt4882/tnt4882_gpib.c

index 05490d1abc96acd59ad55d997a19ab287327c9cc..3f4f95b7fe34ac68b7a8676f1faade74b36d2b2d 100644 (file)
@@ -808,15 +808,15 @@ void agilent_82350b_detach(gpib_board_t *board)
                if (a_priv->gpib_base) {
                        tms9914_board_reset(tms_priv);
                        if (a_priv->misc_base)
-                               iounmap((void *)a_priv->misc_base);
+                               iounmap(a_priv->misc_base);
                        if (a_priv->borg_base)
-                               iounmap((void *)a_priv->borg_base);
+                               iounmap(a_priv->borg_base);
                        if (a_priv->sram_base)
-                               iounmap((void *)a_priv->sram_base);
+                               iounmap(a_priv->sram_base);
                        if (a_priv->gpib_base)
-                               iounmap((void *)a_priv->gpib_base);
+                               iounmap(a_priv->gpib_base);
                        if (a_priv->plx_base)
-                               iounmap((void *)a_priv->plx_base);
+                               iounmap(a_priv->plx_base);
                        pci_release_regions(a_priv->pci_device);
                }
                if (a_priv->pci_device)
index 6915c1b2c85bf5c478246a3b907e9de24a99bf91..32b322113c10b65ef13f8c3d4b372505d3129848 100644 (file)
@@ -45,11 +45,11 @@ enum board_model {
 struct agilent_82350b_priv {
        struct tms9914_priv tms9914_priv;
        struct pci_dev *pci_device;
-       void *plx_base; //82350a only
-       void *gpib_base;
-       void *sram_base;
-       void *misc_base;
-       void *borg_base;
+       void __iomem *plx_base; //82350a only
+       void __iomem *gpib_base;
+       void __iomem *sram_base;
+       void __iomem *misc_base;
+       void __iomem *borg_base;
        int irq;
        unsigned short card_mode_bits;
        unsigned short event_status_bits;
index 4e2144d452707b4683fb6b4fb0a98240d1dbb0cc..3e4348196b425548e6d4bb9a115912640e783698 100644 (file)
@@ -21,7 +21,7 @@ struct fluke_priv {
        struct dma_chan *dma_channel;
        u8 *dma_buffer;
        int dma_buffer_size;
-       void *write_transfer_counter;
+       void __iomem *write_transfer_counter;
 };
 
 // cb7210 specific registers and bits
index 60b1bd6d3c15466dc8e4fe604952f0c97fce2ad6..de6fd2164414dc99ec5f535fa8629c1d30aaa61d 100644 (file)
@@ -33,7 +33,7 @@ struct fmh_priv {
        u8 *dma_buffer;
        int dma_buffer_size;
        int dma_burst_length;
-       void *fifo_base;
+       void __iomem *fifo_base;
        unsigned supports_fifo_interrupts : 1;
 };
 
index 0dbd3dc30721988ccc0e6c259bcde75a4b08a7c4..2c970bab654591e58f672f27d6370327668582cb 100644 (file)
@@ -1122,7 +1122,7 @@ static int ines_gpib_config(struct pcmcia_device *link)
 {
        struct local_info *dev;
        int retval;
-       void *virt;
+       void __iomem *virt;
 
        dev = link->priv;
        DEBUG(0, "%s(0x%p)\n", __func__, link);
@@ -1156,7 +1156,7 @@ static int ines_gpib_config(struct pcmcia_device *link)
        }
        virt = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
        writeb((link->resource[2]->start >> 2) & 0xff, virt + 0xf0); // IOWindow base
-       iounmap((void *)virt);
+       iounmap(virt);
 
        /*
         * This actually configures the PCMCIA socket -- setting up
index 60369a5dfb727a5c411e509bf3ebd0e12a40d547..2fd1a29f0c8be257c96ebed0ce528e5ea2cfe194 100644 (file)
@@ -116,7 +116,7 @@ static inline void tnt_paged_writeb(struct tnt4882_priv *priv, unsigned int valu
 /* readb/writeb wrappers */
 static inline unsigned short tnt_readb(struct tnt4882_priv *priv, unsigned long offset)
 {
-       void *address = priv->nec7210_priv.mmiobase + offset;
+       void __iomem *address = priv->nec7210_priv.mmiobase + offset;
        unsigned long flags;
        unsigned short retval;
        spinlock_t *register_lock = &priv->nec7210_priv.register_page_lock;
@@ -154,7 +154,7 @@ static inline unsigned short tnt_readb(struct tnt4882_priv *priv, unsigned long
 
 static inline void tnt_writeb(struct tnt4882_priv *priv, unsigned short value, unsigned long offset)
 {
-       void *address = priv->nec7210_priv.mmiobase + offset;
+       void __iomem *address = priv->nec7210_priv.mmiobase + offset;
        unsigned long flags;
        spinlock_t *register_lock = &priv->nec7210_priv.register_page_lock;