lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230227105806.2394101-8-sergio.paracuellos@gmail.com>
Date:   Mon, 27 Feb 2023 11:58:01 +0100
From:   Sergio Paracuellos <sergio.paracuellos@...il.com>
To:     linux-mips@...r.kernel.org
Cc:     tsbogend@...ha.franken.de, john@...ozen.org,
        linux-kernel@...r.kernel.org, git@...nthomson.fastmail.com.au
Subject: [PATCH 07/12]  mips: ralink: rt288x: define RT2880_SYSC_BASE with __iomem

 So that RT2880_SYSC_BASE can be used later in multiple functions without
 needing to repeat this __iomem declaration each time

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@...il.com>
---
 arch/mips/include/asm/mach-ralink/rt288x.h | 3 ++-
 arch/mips/ralink/rt288x.c                  | 7 +++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/mach-ralink/rt288x.h b/arch/mips/include/asm/mach-ralink/rt288x.h
index 5f213534f0f5..66a999cd1d80 100644
--- a/arch/mips/include/asm/mach-ralink/rt288x.h
+++ b/arch/mips/include/asm/mach-ralink/rt288x.h
@@ -11,7 +11,8 @@
 #ifndef _RT288X_REGS_H_
 #define _RT288X_REGS_H_
 
-#define RT2880_SYSC_BASE		0x00300000
+#define IOMEM(x)			((void __iomem *)(KSEG1ADDR(x)))
+#define RT2880_SYSC_BASE		IOMEM(0x00300000)
 
 #define SYSC_REG_CHIP_NAME0		0x00
 #define SYSC_REG_CHIP_NAME1		0x04
diff --git a/arch/mips/ralink/rt288x.c b/arch/mips/ralink/rt288x.c
index 493335db2fe1..12f339138c4c 100644
--- a/arch/mips/ralink/rt288x.c
+++ b/arch/mips/ralink/rt288x.c
@@ -59,15 +59,14 @@ void __init ralink_of_remap(void)
 
 void __init prom_soc_init(struct ralink_soc_info *soc_info)
 {
-	void __iomem *sysc = (void __iomem *) KSEG1ADDR(RT2880_SYSC_BASE);
 	const char *name;
 	u32 n0;
 	u32 n1;
 	u32 id;
 
-	n0 = __raw_readl(sysc + SYSC_REG_CHIP_NAME0);
-	n1 = __raw_readl(sysc + SYSC_REG_CHIP_NAME1);
-	id = __raw_readl(sysc + SYSC_REG_CHIP_ID);
+	n0 = __raw_readl(RT2880_SYSC_BASE + SYSC_REG_CHIP_NAME0);
+	n1 = __raw_readl(RT2880_SYSC_BASE + SYSC_REG_CHIP_NAME1);
+	id = __raw_readl(RT2880_SYSC_BASE + SYSC_REG_CHIP_ID);
 
 	if (n0 == RT2880_CHIP_NAME0 && n1 == RT2880_CHIP_NAME1) {
 		soc_info->compatible = "ralink,r2880-soc";
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ