diff mbox

ARM: shmobile: Fix is_e2 warning

Message ID 20141029073510.357.85076.sendpatchset@w520 (mailing list archive)
State Superseded
Delegated to: Simon Horman
Headers show

Commit Message

Magnus Damm Oct. 29, 2014, 7:35 a.m. UTC
From: Magnus Damm <damm+renesas@opensource.se>

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.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

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

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Simon Horman Oct. 29, 2014, 7:42 a.m. UTC | #1
On Wed, Oct 29, 2014 at 04:35:10PM +0900, Magnus Damm wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
> 
> 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.
> 
> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
> ---
> 
>  arch/arm/mach-shmobile/setup-rcar-gen2.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- 0001/arch/arm/mach-shmobile/setup-rcar-gen2.c
> +++ work/arch/arm/mach-shmobile/setup-rcar-gen2.c	2014-10-29 16:06:08.000000000 +0900
> @@ -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;

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Magnus Damm Oct. 29, 2014, 7:47 a.m. UTC | #2
Hi Simon,

On Wed, Oct 29, 2014 at 4:42 PM, Simon Horman <horms@verge.net.au> wrote:
> On Wed, Oct 29, 2014 at 04:35:10PM +0900, Magnus Damm wrote:
>> From: Magnus Damm <damm+renesas@opensource.se>
>>
>> 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.
>>
>> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>> ---
>>
>>  arch/arm/mach-shmobile/setup-rcar-gen2.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> --- 0001/arch/arm/mach-shmobile/setup-rcar-gen2.c
>> +++ work/arch/arm/mach-shmobile/setup-rcar-gen2.c     2014-10-29 16:06:08.000000000 +0900
>> @@ -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;
>
> 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.

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

Thanks,

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman Oct. 29, 2014, 7:58 a.m. UTC | #3
On Wed, Oct 29, 2014 at 04:47:20PM +0900, Magnus Damm wrote:
> Hi Simon,
> 
> On Wed, Oct 29, 2014 at 4:42 PM, Simon Horman <horms@verge.net.au> wrote:
> > On Wed, Oct 29, 2014 at 04:35:10PM +0900, Magnus Damm wrote:
> >> From: Magnus Damm <damm+renesas@opensource.se>
> >>
> >> 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.
> >>
> >> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
> >> ---
> >>
> >>  arch/arm/mach-shmobile/setup-rcar-gen2.c |    4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> --- 0001/arch/arm/mach-shmobile/setup-rcar-gen2.c
> >> +++ work/arch/arm/mach-shmobile/setup-rcar-gen2.c     2014-10-29 16:06:08.000000000 +0900
> >> @@ -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;
> >
> > 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.
> 
> Indeed. Perhaps we can simply use "of_machine_is_compatible("renesas,r8a7794")"?

If so that does seem cleaner to me.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 0001/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ work/arch/arm/mach-shmobile/setup-rcar-gen2.c	2014-10-29 16:06:08.000000000 +0900
@@ -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;