Commit a5ec3a21 authored by Herve Codina's avatar Herve Codina

soc: fsl: cpm1: qmc: Fix __iomem addresses declaration

Running sparse (make C=1) on qmc.c raises a lot of warning such as:
  ...
  warning: incorrect type in assignment (different address spaces)
     expected struct cpm_buf_desc [usertype] *[noderef] __iomem bd
     got struct cpm_buf_desc [noderef] [usertype] __iomem *txbd_free
  ...

Indeed, some variable were declared 'type *__iomem var' instead of
'type __iomem *var'.

Use the correct declaration to remove these warnings.

Fixes: 3178d58e ("soc: fsl: cpm1: Add support for QMC")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarHerve Codina <herve.codina@bootlin.com>
Reviewed-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/20231205152116.122512-3-herve.codina@bootlin.com
parent fc0c6415
...@@ -175,7 +175,7 @@ struct qmc_chan { ...@@ -175,7 +175,7 @@ struct qmc_chan {
struct list_head list; struct list_head list;
unsigned int id; unsigned int id;
struct qmc *qmc; struct qmc *qmc;
void *__iomem s_param; void __iomem *s_param;
enum qmc_mode mode; enum qmc_mode mode;
u64 tx_ts_mask; u64 tx_ts_mask;
u64 rx_ts_mask; u64 rx_ts_mask;
...@@ -203,9 +203,9 @@ struct qmc_chan { ...@@ -203,9 +203,9 @@ struct qmc_chan {
struct qmc { struct qmc {
struct device *dev; struct device *dev;
struct tsa_serial *tsa_serial; struct tsa_serial *tsa_serial;
void *__iomem scc_regs; void __iomem *scc_regs;
void *__iomem scc_pram; void __iomem *scc_pram;
void *__iomem dpram; void __iomem *dpram;
u16 scc_pram_offset; u16 scc_pram_offset;
cbd_t __iomem *bd_table; cbd_t __iomem *bd_table;
dma_addr_t bd_dma_addr; dma_addr_t bd_dma_addr;
...@@ -218,37 +218,37 @@ struct qmc { ...@@ -218,37 +218,37 @@ struct qmc {
struct qmc_chan *chans[64]; struct qmc_chan *chans[64];
}; };
static inline void qmc_write16(void *__iomem addr, u16 val) static inline void qmc_write16(void __iomem *addr, u16 val)
{ {
iowrite16be(val, addr); iowrite16be(val, addr);
} }
static inline u16 qmc_read16(void *__iomem addr) static inline u16 qmc_read16(void __iomem *addr)
{ {
return ioread16be(addr); return ioread16be(addr);
} }
static inline void qmc_setbits16(void *__iomem addr, u16 set) static inline void qmc_setbits16(void __iomem *addr, u16 set)
{ {
qmc_write16(addr, qmc_read16(addr) | set); qmc_write16(addr, qmc_read16(addr) | set);
} }
static inline void qmc_clrbits16(void *__iomem addr, u16 clr) static inline void qmc_clrbits16(void __iomem *addr, u16 clr)
{ {
qmc_write16(addr, qmc_read16(addr) & ~clr); qmc_write16(addr, qmc_read16(addr) & ~clr);
} }
static inline void qmc_write32(void *__iomem addr, u32 val) static inline void qmc_write32(void __iomem *addr, u32 val)
{ {
iowrite32be(val, addr); iowrite32be(val, addr);
} }
static inline u32 qmc_read32(void *__iomem addr) static inline u32 qmc_read32(void __iomem *addr)
{ {
return ioread32be(addr); return ioread32be(addr);
} }
static inline void qmc_setbits32(void *__iomem addr, u32 set) static inline void qmc_setbits32(void __iomem *addr, u32 set)
{ {
qmc_write32(addr, qmc_read32(addr) | set); qmc_write32(addr, qmc_read32(addr) | set);
} }
...@@ -318,7 +318,7 @@ int qmc_chan_write_submit(struct qmc_chan *chan, dma_addr_t addr, size_t length, ...@@ -318,7 +318,7 @@ int qmc_chan_write_submit(struct qmc_chan *chan, dma_addr_t addr, size_t length,
{ {
struct qmc_xfer_desc *xfer_desc; struct qmc_xfer_desc *xfer_desc;
unsigned long flags; unsigned long flags;
cbd_t *__iomem bd; cbd_t __iomem *bd;
u16 ctrl; u16 ctrl;
int ret; int ret;
...@@ -374,7 +374,7 @@ static void qmc_chan_write_done(struct qmc_chan *chan) ...@@ -374,7 +374,7 @@ static void qmc_chan_write_done(struct qmc_chan *chan)
void (*complete)(void *context); void (*complete)(void *context);
unsigned long flags; unsigned long flags;
void *context; void *context;
cbd_t *__iomem bd; cbd_t __iomem *bd;
u16 ctrl; u16 ctrl;
/* /*
...@@ -425,7 +425,7 @@ int qmc_chan_read_submit(struct qmc_chan *chan, dma_addr_t addr, size_t length, ...@@ -425,7 +425,7 @@ int qmc_chan_read_submit(struct qmc_chan *chan, dma_addr_t addr, size_t length,
{ {
struct qmc_xfer_desc *xfer_desc; struct qmc_xfer_desc *xfer_desc;
unsigned long flags; unsigned long flags;
cbd_t *__iomem bd; cbd_t __iomem *bd;
u16 ctrl; u16 ctrl;
int ret; int ret;
...@@ -488,7 +488,7 @@ static void qmc_chan_read_done(struct qmc_chan *chan) ...@@ -488,7 +488,7 @@ static void qmc_chan_read_done(struct qmc_chan *chan)
void (*complete)(void *context, size_t size); void (*complete)(void *context, size_t size);
struct qmc_xfer_desc *xfer_desc; struct qmc_xfer_desc *xfer_desc;
unsigned long flags; unsigned long flags;
cbd_t *__iomem bd; cbd_t __iomem *bd;
void *context; void *context;
u16 datalen; u16 datalen;
u16 ctrl; u16 ctrl;
...@@ -663,7 +663,7 @@ static void qmc_chan_reset_rx(struct qmc_chan *chan) ...@@ -663,7 +663,7 @@ static void qmc_chan_reset_rx(struct qmc_chan *chan)
{ {
struct qmc_xfer_desc *xfer_desc; struct qmc_xfer_desc *xfer_desc;
unsigned long flags; unsigned long flags;
cbd_t *__iomem bd; cbd_t __iomem *bd;
u16 ctrl; u16 ctrl;
spin_lock_irqsave(&chan->rx_lock, flags); spin_lock_irqsave(&chan->rx_lock, flags);
...@@ -694,7 +694,7 @@ static void qmc_chan_reset_tx(struct qmc_chan *chan) ...@@ -694,7 +694,7 @@ static void qmc_chan_reset_tx(struct qmc_chan *chan)
{ {
struct qmc_xfer_desc *xfer_desc; struct qmc_xfer_desc *xfer_desc;
unsigned long flags; unsigned long flags;
cbd_t *__iomem bd; cbd_t __iomem *bd;
u16 ctrl; u16 ctrl;
spin_lock_irqsave(&chan->tx_lock, flags); spin_lock_irqsave(&chan->tx_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment