Skip to contentSkip to conversation

ARM: shmobile: add sh_pm_runtime_init() to header

RFC Ben Hutchings 2 participants 4 messages Mar 17, 2014 SuperH

lore
Share & tools
lore
#0 lore raw
Quoted 1 line · Ben Dooks

Add definition of sh_pm_runtime_init() to machine header to allow calling

declaration not definition

Quoted 12 lines

the pm_runtime initialisation code.

---
 arch/arm/mach-shmobile/include/mach/common.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-shmobile/include/mach/common.h +0 -0
index cb8e32d..4727d4f 100644

arch/arm/mach-shmobile/include/mach/common.h static inline void __init shmobile_init_late(void) · line 57

Quoted 6 lines
arch/arm/mach-shmobile/include/mach/common.h +2 -0
@@ -52,4 +52,6 @@ static inline void __init shmobile_init_late(void)
 	shmobile_cpuidle_init();
 }
 
+extern int sh_pm_runtime_init(void);
+
 #endif /* __ARCH_MACH_COMMON_H */

The declaration should include '__init' and need not include 'extern'.

I would fold this into the previous patch.

Ben.

#1 lore raw

Hello.

Quoted 19 lines · Ben Hutchings
Quoted 1 line

Add definition of sh_pm_runtime_init() to machine header to allow calling

declaration not definition

Quoted 15 lines

the pm_runtime initialisation code.

---
  arch/arm/mach-shmobile/include/mach/common.h | 2 ++
  1 file changed, 2 insertions(+)
arch/arm/mach-shmobile/include/mach/common.h +0 -0
index cb8e32d..4727d4f 100644
@@ -52,4 +52,6 @@ static inline void __init shmobile_init_late(void)
  	shmobile_cpuidle_init();
  }
 
Quoted 5 lines

arch/arm/mach-shmobile/include/mach/common.h static inline void __init shmobile_init_late(void) · line 57

Quoted 3 lines
arch/arm/mach-shmobile/include/mach/common.h +2 -0
+extern int sh_pm_runtime_init(void);
+
  #endif /* __ARCH_MACH_COMMON_H */

The declaration should include '__init'

Since when? It makes no sense for declarations.

Quoted 1 line

and need not include 'extern'.

WBR, Sergei

#2 lore raw
In reply to Ben Hutchings
Quoted 23 lines · Sergei Shtylyov

Hello.

Quoted 19 lines · Ben Hutchings
Quoted 1 line

Add definition of sh_pm_runtime_init() to machine header to allow calling

declaration not definition

Quoted 15 lines

the pm_runtime initialisation code.

---
  arch/arm/mach-shmobile/include/mach/common.h | 2 ++
  1 file changed, 2 insertions(+)
arch/arm/mach-shmobile/include/mach/common.h +0 -0
index cb8e32d..4727d4f 100644
@@ -52,4 +52,6 @@ static inline void __init shmobile_init_late(void)
  	shmobile_cpuidle_init();
  }
 
Quoted 7 lines
Quoted 5 lines

arch/arm/mach-shmobile/include/mach/common.h static inline void __init shmobile_init_late(void) · line 57

Quoted 3 lines
arch/arm/mach-shmobile/include/mach/common.h +2 -0
+extern int sh_pm_runtime_init(void);
+
  #endif /* __ARCH_MACH_COMMON_H */

The declaration should include '__init'

Since when? It makes no sense for declarations.

It doesn't make any difference to the compiler, but it can be useful for the programmer to see it.

Ben.

Quoted 4 lines
Quoted 1 line

and need not include 'extern'.

WBR, Sergei

#3 lore raw
In reply to Ben Hutchings

Hello.

Quoted 25 lines · Ben Hutchings
Quoted 24 lines
Quoted 24 lines
Quoted 1 line

Add definition of sh_pm_runtime_init() to machine header to allow calling

declaration not definition

Quoted 12 lines

the pm_runtime initialisation code.

---
   arch/arm/mach-shmobile/include/mach/common.h | 2 ++
   1 file changed, 2 insertions(+)
arch/arm/mach-shmobile/include/mach/common.h +0 -0
index cb8e32d..4727d4f 100644

arch/arm/mach-shmobile/include/mach/common.h static inline void __init shmobile_init_late(void) · line 57

Quoted 6 lines
arch/arm/mach-shmobile/include/mach/common.h +2 -0
@@ -52,4 +52,6 @@ static inline void __init shmobile_init_late(void)
   	shmobile_cpuidle_init();
   }
 
+extern int sh_pm_runtime_init(void);
+
   #endif /* __ARCH_MACH_COMMON_H */

The declaration should include '__init'

Quoted 4 lines
Quoted 1 line

Since when? It makes no sense for declarations.

It doesn't make any difference to the compiler, but it can be useful for the programmer to see it.

I personally use 'make TAGS' on the kernel directory, and EMACS then shows
me the function definition, not declaration when I press <Alt>-<.> (I wish it always worked correctly though). In general, people tend to remove '__init' from the declarations as I could observe so far...

Quoted 3 lines

Ben.

Quoted 1 line
Quoted 1 line

and need not include 'extern'.

WBR, Sergei