Skip to contentSkip to conversation

ARM: shmobile: Fix is_e2 warning

PATCH In review Magnus Damm 2 participants 2 messages Dec 3, 2014 – Dec 4, 2014

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH v2 1/1 ARM: shmobile: Fix is_e2 warning

From: Magnus Damm <[email protected]>

Fix "is_e2" warning introduced by:

9ce3fa6 ARM: shmobile: rcar-gen2: Add CA7 arch_timer initialization for r8a7794

Only triggers on kernel configurations that have ARCH_ARM_TIMER=n.

---

Changes since V1:
- Use of_machine_is_compatible()

 arch/arm/mach-shmobile/setup-rcar-gen2.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -3
@@ -52,15 +52,13 @@ void __init rcar_gen2_timer_init(void)
 {
 #if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK)
 	u32 mode = rcar_gen2_read_mode_pins();
-	bool is_e2 = (bool)of_find_compatible_node(NULL, NULL,
-		"renesas,r8a7794");
 #endif
 #ifdef CONFIG_ARM_ARCH_TIMER
 	void __iomem *base;
 	int extal_mhz = 0;
 	u32 freq;
 
-	if (is_e2) {
+	if (of_machine_is_compatible("renesas,r8a7794")) {
 		freq = 260000000 / 8;	/* ZS / 8 */
 		/* CNTVOFF has to be initialized either from non-secure
 		 * Hypervisor mode or secure Monitor mode with SCR.NS=1.
#1 lore raw
Quoted 10 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Fix "is_e2" warning introduced by:

9ce3fa6 ARM: shmobile: rcar-gen2: Add CA7 arch_timer initialization for r8a7794

Only triggers on kernel configurations that have ARCH_ARM_TIMER=n.

---

Thanks Magnus,

I have queued this up.

Quoted 9 lines

Changes since V1:
- Use of_machine_is_compatible()

 arch/arm/mach-shmobile/setup-rcar-gen2.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

arch/arm/mach-shmobile/setup-rcar-gen2.c void __init rcar_gen2_timer_init(void) · line 56

Quoted 5 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -2
@@ -52,15 +52,13 @@ void __init rcar_gen2_timer_init(void)
 {
 #if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK)
 	u32 mode = rcar_gen2_read_mode_pins();
-	bool is_e2 = (bool)of_find_compatible_node(NULL, NULL,
-		"renesas,r8a7794");

One less cast in the world, awesome!!!

Quoted 12 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -1
 #endif
 #ifdef CONFIG_ARM_ARCH_TIMER
 	void __iomem *base;
 	int extal_mhz = 0;
 	u32 freq;
 
-	if (is_e2) {
+	if (of_machine_is_compatible("renesas,r8a7794")) {
 		freq = 260000000 / 8;	/* ZS / 8 */
 		/* CNTVOFF has to be initialized either from non-secure
 		 * Hypervisor mode or secure Monitor mode with SCR.NS=1.