From: Dave Penkler <dpenkler@gmail.com>
To: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Cc: Dave Penkler <dpenkler@gmail.com>
Subject: [PATCH 1/4] staging: gpib: Use __iomem attribute for io addresses
Date: Tue, 14 Jan 2025 17:54:00 +0100 [thread overview]
Message-ID: <20250114165403.16410-2-dpenkler@gmail.com> (raw)
In-Reply-To: <20250114165403.16410-1-dpenkler@gmail.com>
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>
---
drivers/staging/gpib/agilent_82350b/agilent_82350b.c | 10 +++++-----
drivers/staging/gpib/agilent_82350b/agilent_82350b.h | 10 +++++-----
drivers/staging/gpib/eastwood/fluke_gpib.h | 2 +-
drivers/staging/gpib/fmh_gpib/fmh_gpib.h | 2 +-
drivers/staging/gpib/ines/ines_gpib.c | 4 ++--
drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 4 ++--
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
index 05490d1abc96..3f4f95b7fe34 100644
--- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
+++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
@@ -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)
diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.h b/drivers/staging/gpib/agilent_82350b/agilent_82350b.h
index 6915c1b2c85b..32b322113c10 100644
--- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.h
+++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.h
@@ -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;
diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.h b/drivers/staging/gpib/eastwood/fluke_gpib.h
index 4e2144d45270..3e4348196b42 100644
--- a/drivers/staging/gpib/eastwood/fluke_gpib.h
+++ b/drivers/staging/gpib/eastwood/fluke_gpib.h
@@ -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
diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.h b/drivers/staging/gpib/fmh_gpib/fmh_gpib.h
index 60b1bd6d3c15..de6fd2164414 100644
--- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.h
+++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.h
@@ -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;
};
diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c
index 0dbd3dc30721..2c970bab6545 100644
--- a/drivers/staging/gpib/ines/ines_gpib.c
+++ b/drivers/staging/gpib/ines/ines_gpib.c
@@ -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
diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
index 60369a5dfb72..2fd1a29f0c8b 100644
--- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
+++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
@@ -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;
--
2.47.1
next prev parent reply other threads:[~2025-01-14 16:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 16:53 [PATCH 0/4] staging: gpib: Clean up types and struct initialization Dave Penkler
2025-01-14 16:54 ` Dave Penkler [this message]
2025-01-14 16:54 ` [PATCH 2/4] staging: gpib: Use __user for user space pointers Dave Penkler
2025-01-14 16:54 ` [PATCH 3/4] staging: gpib: Avoid plain integers as NULL pointers Dave Penkler
2025-01-14 16:54 ` [PATCH 4/4] staging: gpib: Use C99 syntax and make static Dave Penkler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250114165403.16410-2-dpenkler@gmail.com \
--to=dpenkler@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox