* [PATCH] mips: ralink: mt7621: avoid casting away __iomem in wraparound test
@ 2026-10-04 18:48 Rosen Penev
0 siblings, 0 replies; only message in thread
From: Rosen Penev @ 2026-10-04 18:48 UTC (permalink / raw)
To: linux-mips
Cc: John Crispin, Sergio Paracuellos, Thomas Bogendoerfer,
Matthias Brugger, AngeloGioacchino Del Regno, Rosen Penev,
open list:ARM/Mediatek SoC support,
moderated list:ARM/Mediatek SoC support,
moderated list:ARM/Mediatek SoC support
CPHYSADDR() casts its argument to an integer, which strips the __iomem
annotation from dm and triggers a sparse warning. Compute the physical
address from detect_magic directly. The result is unchanged since the
sum never exceeds the 512MB KSEG mask.
Fixes: 4ddaf88aadd3 ("mips: ralink: mt7621: add missing __iomem")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610041411.uJXWXF8i-lkp@intel.com/
Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
arch/mips/ralink/mt7621.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/ralink/mt7621.c b/arch/mips/ralink/mt7621.c
index ae7b8cfedd5f..2d10c74b13c1 100644
--- a/arch/mips/ralink/mt7621.c
+++ b/arch/mips/ralink/mt7621.c
@@ -65,7 +65,7 @@ static bool __init mt7621_addr_wraparound_test(phys_addr_t size)
{
void __iomem *dm = (void __iomem *)KSEG1ADDR(&detect_magic);
- if (CPHYSADDR(dm + size) >= MT7621_LOWMEM_MAX_SIZE)
+ if (CPHYSADDR(&detect_magic) + size >= MT7621_LOWMEM_MAX_SIZE)
return true;
__raw_writel(MT7621_MEM_TEST_PATTERN, dm);
if (__raw_readl(dm) != __raw_readl(dm + size))
--
2.56.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-04 18:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-04 18:48 [PATCH] mips: ralink: mt7621: avoid casting away __iomem in wraparound test Rosen Penev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®