Skip to contentSkip to conversation

ARM: shmobile: Fix is_e2 warning

PATCH Superseded Magnus Damm 2 participants 4 messages Oct 29, 2014

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 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.

---

 arch/arm/mach-shmobile/setup-rcar-gen2.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c +2 -2
@@ -52,10 +52,10 @@ 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
+	bool is_e2 = (bool)of_find_compatible_node(NULL, NULL,
+		"renesas,r8a7794");
 	void __iomem *base;
 	int extal_mhz = 0;
 	u32 freq;
#1 lore raw
Quoted 19 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.

---

 arch/arm/mach-shmobile/setup-rcar-gen2.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -0
@@ -52,10 +52,10 @@ void __init rcar_gen2_timer_init(void)
 {
 #if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK)

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

Quoted 10 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +2 -2
 	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
+	bool is_e2 = (bool)of_find_compatible_node(NULL, NULL,
+		"renesas,r8a7794");
 	void __iomem *base;
 	int extal_mhz = 0;
 	u32 freq;

Not strictly related, but I wonder if we can avoid the cast by changing the type of is_e2 to struct device_node *. Also changing the variable name might make sense in that scenario.

Casting makes me sad.

author maintainer
#2 lore raw
In reply to Magnus Damm

Hi Simon,

Quoted 35 lines · Simon Horman
Quoted 19 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.

---

 arch/arm/mach-shmobile/setup-rcar-gen2.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-10-29 16:06:08.000000000 +0900 renamed from arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -0
@@ -52,10 +52,10 @@ void __init rcar_gen2_timer_init(void)
 {
 #if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK)

arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-10-29 16:06:08.000000000 +0900 void __init rcar_gen2_timer_init(void) · line 61

Quoted 10 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-10-29 16:06:08.000000000 +0900 renamed from arch/arm/mach-shmobile/setup-rcar-gen2.c +2 -2
      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
+     bool is_e2 = (bool)of_find_compatible_node(NULL, NULL,
+             "renesas,r8a7794");
      void __iomem *base;
      int extal_mhz = 0;
      u32 freq;

Not strictly related, but I wonder if we can avoid the cast by changing the type of is_e2 to struct device_node *. Also changing the variable name might make sense in that scenario.

Quoted 1 line

Casting makes me sad.

Indeed. Perhaps we can simply use "of_machine_is_compatible("renesas,r8a7794")"?

Thanks,

/ magnus

#3 lore raw
In reply to Magnus Damm
Quoted 38 lines · Magnus Damm

Hi Simon,

Quoted 35 lines · Simon Horman
Quoted 19 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.

---

 arch/arm/mach-shmobile/setup-rcar-gen2.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-10-29 16:06:08.000000000 +0900 renamed from arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -0
@@ -52,10 +52,10 @@ void __init rcar_gen2_timer_init(void)
 {
 #if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK)

arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-10-29 16:06:08.000000000 +0900 void __init rcar_gen2_timer_init(void) · line 61

Quoted 10 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c 2014-10-29 16:06:08.000000000 +0900 renamed from arch/arm/mach-shmobile/setup-rcar-gen2.c +2 -2
      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
+     bool is_e2 = (bool)of_find_compatible_node(NULL, NULL,
+             "renesas,r8a7794");
      void __iomem *base;
      int extal_mhz = 0;
      u32 freq;

Not strictly related, but I wonder if we can avoid the cast by changing the type of is_e2 to struct device_node *. Also changing the variable name might make sense in that scenario.

Quoted 3 lines
Quoted 1 line

Casting makes me sad.

Indeed. Perhaps we can simply use "of_machine_is_compatible("renesas,r8a7794")"?

If so that does seem cleaner to me.