* [net PATCH] octeontx2: Annotate mmio regions as __iomem
@ 2025-05-28 5:15 Subbaraya Sundeep
2025-05-28 14:57 ` Simon Horman
0 siblings, 1 reply; 3+ messages in thread
From: Subbaraya Sundeep @ 2025-05-28 5:15 UTC (permalink / raw)
To: andrew+netdev, davem, edumazet, kuba, pabeni, horms, saikrishnag,
gakula, hkelam, sgoutham, lcherian, bbhushan2, jerinj
Cc: netdev, Subbaraya Sundeep
This patch removes unnecessary typecasts by marking the
mbox_regions array as __iomem since it is used to store
pointers to memory-mapped I/O (MMIO) regions. Also simplified
the call to readq() in PF driver by removing redundant type casts.
Fixes: 98c561116360 ("octeontx2-af: cn10k: Add mbox support for CN10K platform")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
---
drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 12 ++++++------
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 3 +--
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
index 6575c42..5e0cc3a 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
@@ -2359,7 +2359,7 @@ static inline void rvu_afvf_mbox_up_handler(struct work_struct *work)
__rvu_mbox_up_handler(mwork, TYPE_AFVF);
}
-static int rvu_get_mbox_regions(struct rvu *rvu, void **mbox_addr,
+static int rvu_get_mbox_regions(struct rvu *rvu, void __iomem **mbox_addr,
int num, int type, unsigned long *pf_bmap)
{
struct rvu_hwinfo *hw = rvu->hw;
@@ -2384,7 +2384,7 @@ static int rvu_get_mbox_regions(struct rvu *rvu, void **mbox_addr,
bar4 = rvupf_read64(rvu, RVU_PF_VF_BAR4_ADDR);
bar4 += region * MBOX_SIZE;
}
- mbox_addr[region] = (void *)ioremap_wc(bar4, MBOX_SIZE);
+ mbox_addr[region] = ioremap_wc(bar4, MBOX_SIZE);
if (!mbox_addr[region])
goto error;
}
@@ -2407,7 +2407,7 @@ static int rvu_get_mbox_regions(struct rvu *rvu, void **mbox_addr,
RVU_AF_PF_BAR4_ADDR);
bar4 += region * MBOX_SIZE;
}
- mbox_addr[region] = (void *)ioremap_wc(bar4, MBOX_SIZE);
+ mbox_addr[region] = ioremap_wc(bar4, MBOX_SIZE);
if (!mbox_addr[region])
goto error;
}
@@ -2415,7 +2415,7 @@ static int rvu_get_mbox_regions(struct rvu *rvu, void **mbox_addr,
error:
while (region--)
- iounmap((void __iomem *)mbox_addr[region]);
+ iounmap(mbox_addr[region]);
return -ENOMEM;
}
@@ -2425,10 +2425,10 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw,
void (mbox_up_handler)(struct work_struct *))
{
int err = -EINVAL, i, dir, dir_up;
+ void __iomem **mbox_regions;
void __iomem *reg_base;
struct rvu_work *mwork;
unsigned long *pf_bmap;
- void **mbox_regions;
const char *name;
u64 cfg;
@@ -2451,7 +2451,7 @@ static int rvu_mbox_init(struct rvu *rvu, struct mbox_wq_info *mw,
mutex_init(&rvu->mbox_lock);
- mbox_regions = kcalloc(num, sizeof(void *), GFP_KERNEL);
+ mbox_regions = kcalloc(num, sizeof(void __iomem *), GFP_KERNEL);
if (!mbox_regions) {
err = -ENOMEM;
goto free_bitmap;
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index b303a03..cd818d2 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -596,8 +596,7 @@ static int otx2_pfvf_mbox_init(struct otx2_nic *pf, int numvfs)
base = pci_resource_start(pf->pdev, PCI_MBOX_BAR_NUM) +
MBOX_SIZE;
else
- base = readq((void __iomem *)((u64)pf->reg_base +
- RVU_PF_VF_BAR4_ADDR));
+ base = readq(pf->reg_base + RVU_PF_VF_BAR4_ADDR);
hwbase = ioremap_wc(base, MBOX_SIZE * pf->total_vfs);
if (!hwbase) {
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [net PATCH] octeontx2: Annotate mmio regions as __iomem
2025-05-28 5:15 [net PATCH] octeontx2: Annotate mmio regions as __iomem Subbaraya Sundeep
@ 2025-05-28 14:57 ` Simon Horman
2025-05-29 7:07 ` Subbaraya Sundeep
0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2025-05-28 14:57 UTC (permalink / raw)
To: Subbaraya Sundeep
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, saikrishnag, gakula,
hkelam, sgoutham, lcherian, bbhushan2, jerinj, netdev
On Wed, May 28, 2025 at 10:45:27AM +0530, Subbaraya Sundeep wrote:
> This patch removes unnecessary typecasts by marking the
> mbox_regions array as __iomem since it is used to store
> pointers to memory-mapped I/O (MMIO) regions. Also simplified
> the call to readq() in PF driver by removing redundant type casts.
>
> Fixes: 98c561116360 ("octeontx2-af: cn10k: Add mbox support for CN10K platform")
> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Thanks Subbaraya,
As per my comment on [1], I wonder if this is more of a clean-up
for net-next (once it re-opens, no Fixes tag) than a fix.
[1] Re: [net v2 PATCH] octeontx2-pf: Avoid typecasts by simplifying otx2_atomic64_add macro
https://lore.kernel.org/netdev/20250528125501.GC365796@horms.kernel.org/T/#t
...
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [net PATCH] octeontx2: Annotate mmio regions as __iomem
2025-05-28 14:57 ` Simon Horman
@ 2025-05-29 7:07 ` Subbaraya Sundeep
0 siblings, 0 replies; 3+ messages in thread
From: Subbaraya Sundeep @ 2025-05-29 7:07 UTC (permalink / raw)
To: Simon Horman
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, saikrishnag, gakula,
hkelam, sgoutham, lcherian, bbhushan2, jerinj, netdev
Hi Simon,
On 2025-05-28 at 14:57:47, Simon Horman (horms@kernel.org) wrote:
> On Wed, May 28, 2025 at 10:45:27AM +0530, Subbaraya Sundeep wrote:
> > This patch removes unnecessary typecasts by marking the
> > mbox_regions array as __iomem since it is used to store
> > pointers to memory-mapped I/O (MMIO) regions. Also simplified
> > the call to readq() in PF driver by removing redundant type casts.
> >
> > Fixes: 98c561116360 ("octeontx2-af: cn10k: Add mbox support for CN10K platform")
> > Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
>
> Thanks Subbaraya,
>
> As per my comment on [1], I wonder if this is more of a clean-up
> for net-next (once it re-opens, no Fixes tag) than a fix.
>
> [1] Re: [net v2 PATCH] octeontx2-pf: Avoid typecasts by simplifying otx2_atomic64_add macro
> https://lore.kernel.org/netdev/20250528125501.GC365796@horms.kernel.org/T/#t
>
Sure.
Thanks,
Sundeep
> ...
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-29 7:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-28 5:15 [net PATCH] octeontx2: Annotate mmio regions as __iomem Subbaraya Sundeep
2025-05-28 14:57 ` Simon Horman
2025-05-29 7:07 ` Subbaraya Sundeep
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).