Skip to content

Commit 77b41a9

Browse files
dpenklergregkh
authored andcommitted
staging: gpib: Use __iomem attribute for io addresses
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d43f18d commit 77b41a9

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

drivers/staging/gpib/agilent_82350b/agilent_82350b.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -808,15 +808,15 @@ void agilent_82350b_detach(gpib_board_t *board)
808808
if (a_priv->gpib_base) {
809809
tms9914_board_reset(tms_priv);
810810
if (a_priv->misc_base)
811-
iounmap((void *)a_priv->misc_base);
811+
iounmap(a_priv->misc_base);
812812
if (a_priv->borg_base)
813-
iounmap((void *)a_priv->borg_base);
813+
iounmap(a_priv->borg_base);
814814
if (a_priv->sram_base)
815-
iounmap((void *)a_priv->sram_base);
815+
iounmap(a_priv->sram_base);
816816
if (a_priv->gpib_base)
817-
iounmap((void *)a_priv->gpib_base);
817+
iounmap(a_priv->gpib_base);
818818
if (a_priv->plx_base)
819-
iounmap((void *)a_priv->plx_base);
819+
iounmap(a_priv->plx_base);
820820
pci_release_regions(a_priv->pci_device);
821821
}
822822
if (a_priv->pci_device)

drivers/staging/gpib/agilent_82350b/agilent_82350b.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ enum board_model {
4545
struct agilent_82350b_priv {
4646
struct tms9914_priv tms9914_priv;
4747
struct pci_dev *pci_device;
48-
void *plx_base; //82350a only
49-
void *gpib_base;
50-
void *sram_base;
51-
void *misc_base;
52-
void *borg_base;
48+
void __iomem *plx_base; //82350a only
49+
void __iomem *gpib_base;
50+
void __iomem *sram_base;
51+
void __iomem *misc_base;
52+
void __iomem *borg_base;
5353
int irq;
5454
unsigned short card_mode_bits;
5555
unsigned short event_status_bits;

drivers/staging/gpib/eastwood/fluke_gpib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct fluke_priv {
2121
struct dma_chan *dma_channel;
2222
u8 *dma_buffer;
2323
int dma_buffer_size;
24-
void *write_transfer_counter;
24+
void __iomem *write_transfer_counter;
2525
};
2626

2727
// cb7210 specific registers and bits

drivers/staging/gpib/fmh_gpib/fmh_gpib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct fmh_priv {
3333
u8 *dma_buffer;
3434
int dma_buffer_size;
3535
int dma_burst_length;
36-
void *fifo_base;
36+
void __iomem *fifo_base;
3737
unsigned supports_fifo_interrupts : 1;
3838
};
3939

drivers/staging/gpib/ines/ines_gpib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ static int ines_gpib_config(struct pcmcia_device *link)
11221122
{
11231123
struct local_info *dev;
11241124
int retval;
1125-
void *virt;
1125+
void __iomem *virt;
11261126

11271127
dev = link->priv;
11281128
DEBUG(0, "%s(0x%p)\n", __func__, link);
@@ -1156,7 +1156,7 @@ static int ines_gpib_config(struct pcmcia_device *link)
11561156
}
11571157
virt = ioremap(link->resource[2]->start, resource_size(link->resource[2]));
11581158
writeb((link->resource[2]->start >> 2) & 0xff, virt + 0xf0); // IOWindow base
1159-
iounmap((void *)virt);
1159+
iounmap(virt);
11601160

11611161
/*
11621162
* This actually configures the PCMCIA socket -- setting up

drivers/staging/gpib/tnt4882/tnt4882_gpib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static inline void tnt_paged_writeb(struct tnt4882_priv *priv, unsigned int valu
116116
/* readb/writeb wrappers */
117117
static inline unsigned short tnt_readb(struct tnt4882_priv *priv, unsigned long offset)
118118
{
119-
void *address = priv->nec7210_priv.mmiobase + offset;
119+
void __iomem *address = priv->nec7210_priv.mmiobase + offset;
120120
unsigned long flags;
121121
unsigned short retval;
122122
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
154154

155155
static inline void tnt_writeb(struct tnt4882_priv *priv, unsigned short value, unsigned long offset)
156156
{
157-
void *address = priv->nec7210_priv.mmiobase + offset;
157+
void __iomem *address = priv->nec7210_priv.mmiobase + offset;
158158
unsigned long flags;
159159
spinlock_t *register_lock = &priv->nec7210_priv.register_page_lock;
160160

0 commit comments

Comments
 (0)