Skip to contentSkip to conversation

ARM: shmobile: r8a7740: Cleanup PM Kconfig usage

PATCH In review Magnus Damm 3 participants 10 messages Sep 4, 2014 – Sep 30, 2014

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 1/1 ARM: shmobile: r8a7740: Cleanup PM Kconfig usage

From: Magnus Damm <[email protected]>

Simplify the r8a7740 PM code by using CONFIG_PM_RMOBILE instead of having a complex #if expression embedded in the C code.

---

Built on top of renesas-devel-20140904-v3.17-rc3

 arch/arm/mach-shmobile/pm-r8a7740.c |    6 ++++--
 arch/arm/mach-shmobile/r8a7740.h    |    7 +------
 2 files changed, 5 insertions(+), 8 deletions(-)
arch/arm/mach-shmobile/pm-r8a7740.c +4 -2
@@ -13,7 +13,7 @@
 #include "common.h"
 #include "pm-rmobile.h"
 
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_PM_RMOBILE
 static int r8a7740_pd_a4s_suspend(void)
 {
 	/*
@@ -58,7 +58,9 @@ void __init r8a7740_init_pm_domains(void
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#else
+void r8a7740_init_pm_domains(void) {}
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h +1 -6
@@ -52,11 +52,6 @@ extern void r8a7740_add_standard_devices
 extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
-
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
-extern void __init r8a7740_init_pm_domains(void);
-#else
-static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+extern void r8a7740_init_pm_domains(void);
 
 #endif /* __ASM_R8A7740_H__ */
#1 lore raw
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Simplify the r8a7740 PM code by using CONFIG_PM_RMOBILE instead of having a complex #if expression embedded in the C code.

Thanks Magnus,

this looks good to me.

The dependencies for this changes are a bit messy so I would like to defer it until v3.19. Could you repost it once v3.18-rc6 is released?

Quoted 46 lines

---

Built on top of renesas-devel-20140904-v3.17-rc3

 arch/arm/mach-shmobile/pm-r8a7740.c |    6 ++++--
 arch/arm/mach-shmobile/r8a7740.h    |    7 +------
 2 files changed, 5 insertions(+), 8 deletions(-)
arch/arm/mach-shmobile/pm-r8a7740.c +4 -2
@@ -13,7 +13,7 @@
 #include "common.h"
 #include "pm-rmobile.h"
 
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_PM_RMOBILE
 static int r8a7740_pd_a4s_suspend(void)
 {
 	/*
@@ -58,7 +58,9 @@ void __init r8a7740_init_pm_domains(void
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#else
+void r8a7740_init_pm_domains(void) {}
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h +1 -6
@@ -52,11 +52,6 @@ extern void r8a7740_add_standard_devices
 extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
-
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
-extern void __init r8a7740_init_pm_domains(void);
-#else
-static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+extern void r8a7740_init_pm_domains(void);
 
 #endif /* __ASM_R8A7740_H__ */
author maintainer
#2 lore raw
In reply to Magnus Damm

Hi Simon,

Quoted 6 lines · Simon Horman
Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Simplify the r8a7740 PM code by using CONFIG_PM_RMOBILE instead of having a complex #if expression embedded in the C code.

Quoted 8 lines
Quoted 1 line

Thanks Magnus,

this looks good to me.

The dependencies for this changes are a bit messy so I would like to defer it until v3.19. Could you repost it once v3.18-rc6 is released?

Sure, will do! Does that apply to this patch only, or also to other things like the new (sh73a0 and/or r8a73a4) multiplatform bits and legacy board code removal?

Thanks,

/ magnus

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

Hi Simon,

Quoted 10 lines · Simon Horman
Quoted 6 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Simplify the r8a7740 PM code by using CONFIG_PM_RMOBILE instead of having a complex #if expression embedded in the C code.

Thanks Magnus,

Quoted 8 lines
Quoted 4 lines

this looks good to me.

The dependencies for this changes are a bit messy so I would like to defer it until v3.19. Could you repost it once v3.18-rc6 is released?

Sure, will do! Does that apply to this patch only, or also to other things like the new (sh73a0 and/or r8a73a4) multiplatform bits and legacy board code removal?

At this time I would like to handle-things on a case-by-case basis.

In general it would make my life slightly easier if all futher cleanups were deferred until v3.19. But at this stage I'm still happy to assess each patch on its merits.

#4 lore raw
In reply to Magnus Damm
Quoted 10 lines · Simon Horman
Quoted 9 lines · Magnus Damm

Hi Simon,

Quoted 6 lines · Simon Horman
Quoted 5 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Simplify the r8a7740 PM code by using CONFIG_PM_RMOBILE instead of having a complex #if expression embedded in the C code.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line

Thanks Magnus,

this looks good to me.

The dependencies for this changes are a bit messy so I would like to defer it until v3.19. Could you repost it once v3.18-rc6 is released?

That should read v3.17-rc6.

Quoted 9 lines
Quoted 3 lines

Sure, will do! Does that apply to this patch only, or also to other things like the new (sh73a0 and/or r8a73a4) multiplatform bits and legacy board code removal?

At this time I would like to handle-things on a case-by-case basis.

In general it would make my life slightly easier if all futher cleanups were deferred until v3.19. But at this stage I'm still happy to assess each patch on its merits.

#5 lore raw
In reply to Magnus Damm

Hi Magnus,

Quoted 16 lines · Magnus Damm
arch/arm/mach-shmobile/pm-r8a7740.c +3 -1
@@ -58,7 +58,9 @@ void __init r8a7740_init_pm_domains(void
        rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
        pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#else
+void r8a7740_init_pm_domains(void) {}
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 renamed from arch/arm/mach-shmobile/r8a7740.h +0 -0
@@ -52,11 +52,6 @@ extern void r8a7740_add_standard_devices
 extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);

arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 extern void r8a7740_add_standard_devices · line 57

Quoted 10 lines
arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 renamed from arch/arm/mach-shmobile/r8a7740.h +1 -6
 extern void r8a7740_pm_init(void);
-
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
-extern void __init r8a7740_init_pm_domains(void);
-#else
-static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+extern void r8a7740_init_pm_domains(void);
 
 #endif /* __ASM_R8A7740_H__ */

Why do you make r8a7740_init_pm_domains() out-of-line in the !CONFIG_PM_RMOBILE case?
It increases code size (call to an empty function that cannot be optimized away), and prevents us from building pm-r8a7740.c conditionally on CONFIG_PM_RMOBILE and CONFIG_ARCH_R8A7740 in the future.

For the latter, we can turn pm-rmobile into a library, and do something like

pm-rmobile-objs-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#6 lore raw
In reply to Magnus Damm
Quoted 36 lines · Geert Uytterhoeven

Hi Magnus,

Quoted 16 lines · Magnus Damm
(quoted diff) +3 -1
@@ -58,7 +58,9 @@ void __init r8a7740_init_pm_domains(void
        rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
        pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#else
+void r8a7740_init_pm_domains(void) {}
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 renamed from arch/arm/mach-shmobile/r8a7740.h +0 -0
@@ -52,11 +52,6 @@ extern void r8a7740_add_standard_devices
 extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);

arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 extern void r8a7740_add_standard_devices · line 57

Quoted 10 lines
arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 renamed from arch/arm/mach-shmobile/r8a7740.h +1 -6
 extern void r8a7740_pm_init(void);
-
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
-extern void __init r8a7740_init_pm_domains(void);
-#else
-static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+extern void r8a7740_init_pm_domains(void);
 
 #endif /* __ASM_R8A7740_H__ */

Why do you make r8a7740_init_pm_domains() out-of-line in the !CONFIG_PM_RMOBILE case?
It increases code size (call to an empty function that cannot be optimized away), and prevents us from building pm-r8a7740.c conditionally on CONFIG_PM_RMOBILE and CONFIG_ARCH_R8A7740 in the future.

Quoted 4 lines

For the latter, we can turn pm-rmobile into a library, and do something like

pm-rmobile-objs-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o

This seems to have slipped through the cracks.

For the first part of the problem how about this update to Magnus's patch?

[PATCH v1.1] ARM: shmobile: r8a7740: Cleanup PM Kconfig usage

Simplify the r8a7740 PM code by using CONFIG_PM_RMOBILE instead of having a complex #if expression embedded in the C code.

[[email protected]: do not make r8a7740_init_pm_domains
out-of-line for !CONFIG_PM_RMOBILE case]

---
 arch/arm/mach-shmobile/pm-r8a7740.c | 4 ++--
 arch/arm/mach-shmobile/r8a7740.h    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-shmobile/pm-r8a7740.c +2 -2
index e3f1464..225be5e 100644
@@ -13,7 +13,7 @@
 #include "common.h"
 #include "pm-rmobile.h"
 
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_PM_RMOBILE
 static int r8a7740_pd_a4s_suspend(void)
 {
 	/*
@@ -56,7 +56,7 @@ void __init r8a7740_init_pm_domains(void)
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h +2 -2
index f369b4b..5ba292e 100644
@@ -53,10 +53,10 @@ extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
 
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_PM_RMOBILE
 extern void __init r8a7740_init_pm_domains(void);
 #else
 static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#endif
 
 #endif /* __ASM_R8A7740_H__ */
Signature · 1 line
2.0.1
#7 lore raw
In reply to Magnus Damm
Quoted 37 lines · Simon Horman
Quoted 36 lines · Geert Uytterhoeven

Hi Magnus,

Quoted 16 lines · Magnus Damm
arch/arm/mach-shmobile/pm-r8a7740.c +3 -1
@@ -58,7 +58,9 @@ void __init r8a7740_init_pm_domains(void
        rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
        pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#else
+void r8a7740_init_pm_domains(void) {}
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 renamed from arch/arm/mach-shmobile/r8a7740.h +0 -0
@@ -52,11 +52,6 @@ extern void r8a7740_add_standard_devices
 extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);

arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 extern void r8a7740_add_standard_devices · line 57

Quoted 10 lines
arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 renamed from arch/arm/mach-shmobile/r8a7740.h +1 -6
 extern void r8a7740_pm_init(void);
-
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
-extern void __init r8a7740_init_pm_domains(void);
-#else
-static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+extern void r8a7740_init_pm_domains(void);
 
 #endif /* __ASM_R8A7740_H__ */

Why do you make r8a7740_init_pm_domains() out-of-line in the !CONFIG_PM_RMOBILE case?
It increases code size (call to an empty function that cannot be optimized away), and prevents us from building pm-r8a7740.c conditionally on CONFIG_PM_RMOBILE and CONFIG_ARCH_R8A7740 in the future.

Quoted 6 lines
Quoted 4 lines

For the latter, we can turn pm-rmobile into a library, and do something like

pm-rmobile-objs-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o

This seems to have slipped through the cracks.

Geert, are you happy with this?

Quoted 64 lines

For the first part of the problem how about this update to Magnus's patch?

[PATCH v1.1] ARM: shmobile: r8a7740: Cleanup PM Kconfig usage

Simplify the r8a7740 PM code by using CONFIG_PM_RMOBILE instead of having a complex #if expression embedded in the C code.

[[email protected]: do not make r8a7740_init_pm_domains
out-of-line for !CONFIG_PM_RMOBILE case]

---
 arch/arm/mach-shmobile/pm-r8a7740.c | 4 ++--
 arch/arm/mach-shmobile/r8a7740.h    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-shmobile/pm-r8a7740.c +2 -2
index e3f1464..225be5e 100644
@@ -13,7 +13,7 @@
 #include "common.h"
 #include "pm-rmobile.h"
 
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_PM_RMOBILE
 static int r8a7740_pd_a4s_suspend(void)
 {
 	/*
@@ -56,7 +56,7 @@ void __init r8a7740_init_pm_domains(void)
 	rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
 	pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h +2 -2
index f369b4b..5ba292e 100644
@@ -53,10 +53,10 @@ extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
 
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_PM_RMOBILE
 extern void __init r8a7740_init_pm_domains(void);
 #else
 static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#endif
 
 #endif /* __ASM_R8A7740_H__ */
Signature · 7 lines
2.0.1


--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#8 lore raw
In reply to Magnus Damm

Hi Simon, Magnus,

Quoted 36 lines · Simon Horman
Quoted 35 lines · Simon Horman
Quoted 34 lines · Geert Uytterhoeven
Quoted 16 lines · Magnus Damm
arch/arm/mach-shmobile/pm-r8a7740.c +3 -1
@@ -58,7 +58,9 @@ void __init r8a7740_init_pm_domains(void
        rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
        pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#else
+void r8a7740_init_pm_domains(void) {}
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 renamed from arch/arm/mach-shmobile/r8a7740.h +0 -0
@@ -52,11 +52,6 @@ extern void r8a7740_add_standard_devices
 extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);

arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 extern void r8a7740_add_standard_devices · line 57

Quoted 10 lines
arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 renamed from arch/arm/mach-shmobile/r8a7740.h +1 -6
 extern void r8a7740_pm_init(void);
-
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
-extern void __init r8a7740_init_pm_domains(void);
-#else
-static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+extern void r8a7740_init_pm_domains(void);
 
 #endif /* __ASM_R8A7740_H__ */

Why do you make r8a7740_init_pm_domains() out-of-line in the !CONFIG_PM_RMOBILE case?
It increases code size (call to an empty function that cannot be optimized away), and prevents us from building pm-r8a7740.c conditionally on CONFIG_PM_RMOBILE and CONFIG_ARCH_R8A7740 in the future.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

For the latter, we can turn pm-rmobile into a library, and do something like

pm-rmobile-objs-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o

This seems to have slipped through the cracks.

Geert, are you happy with this?

I'd like to ask to drop this patch, as I'll have to revert this hunk in pm-r8a7740.c:

    -#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
    +#ifdef CONFIG_PM_RMOBILE

to add DT PM domain support.

Is that OK for you?

BTW, changing

    -#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
    +#if defined(CONFIG_PM_RMOBILE) && !defined(CONFIG_ARCH_MULTIPLATFORM)

is fine for me, though, but I don't know it's worth the effort.

Quoted 54 lines
Quoted 54 lines

For the first part of the problem how about this update to Magnus's patch?

[PATCH v1.1] ARM: shmobile: r8a7740: Cleanup PM Kconfig usage

Simplify the r8a7740 PM code by using CONFIG_PM_RMOBILE instead of having a complex #if expression embedded in the C code.

[[email protected]: do not make r8a7740_init_pm_domains
out-of-line for !CONFIG_PM_RMOBILE case]

---
 arch/arm/mach-shmobile/pm-r8a7740.c | 4 ++--
 arch/arm/mach-shmobile/r8a7740.h    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-shmobile/pm-r8a7740.c +2 -2
index e3f1464..225be5e 100644
@@ -13,7 +13,7 @@
 #include "common.h"
 #include "pm-rmobile.h"
 
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_PM_RMOBILE
 static int r8a7740_pd_a4s_suspend(void)
 {
      /*
@@ -56,7 +56,7 @@ void __init r8a7740_init_pm_domains(void)
      rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
      pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h +2 -2
index f369b4b..5ba292e 100644
@@ -53,10 +53,10 @@ extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
 
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_PM_RMOBILE
 extern void __init r8a7740_init_pm_domains(void);
 #else
 static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#endif
 
Quoted 3 lines
Quoted 3 lines
arch/arm/mach-shmobile/r8a7740.h +0 -1
 #endif /* __ASM_R8A7740_H__ */
--

2.0.1

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#9 lore raw
In reply to Magnus Damm
Quoted 51 lines · Geert Uytterhoeven

Hi Simon, Magnus,

Quoted 36 lines · Simon Horman
Quoted 35 lines · Simon Horman
Quoted 34 lines · Geert Uytterhoeven
Quoted 16 lines · Magnus Damm
arch/arm/mach-shmobile/pm-r8a7740.c +3 -1
@@ -58,7 +58,9 @@ void __init r8a7740_init_pm_domains(void
        rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
        pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#else
+void r8a7740_init_pm_domains(void) {}
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 renamed from arch/arm/mach-shmobile/r8a7740.h +0 -0
@@ -52,11 +52,6 @@ extern void r8a7740_add_standard_devices
 extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);

arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 extern void r8a7740_add_standard_devices · line 57

Quoted 10 lines
arch/arm/mach-shmobile/r8a7740.h 2014-09-04 12:29:12.000000000 +0900 renamed from arch/arm/mach-shmobile/r8a7740.h +1 -6
 extern void r8a7740_pm_init(void);
-
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
-extern void __init r8a7740_init_pm_domains(void);
-#else
-static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+extern void r8a7740_init_pm_domains(void);
 
 #endif /* __ASM_R8A7740_H__ */

Why do you make r8a7740_init_pm_domains() out-of-line in the !CONFIG_PM_RMOBILE case?
It increases code size (call to an empty function that cannot be optimized away), and prevents us from building pm-r8a7740.c conditionally on CONFIG_PM_RMOBILE and CONFIG_ARCH_R8A7740 in the future.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

For the latter, we can turn pm-rmobile into a library, and do something like

pm-rmobile-objs-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o

This seems to have slipped through the cracks.

Geert, are you happy with this?

I'd like to ask to drop this patch, as I'll have to revert this hunk in pm-r8a7740.c:

Quoted 6 lines
    -#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
    +#ifdef CONFIG_PM_RMOBILE

to add DT PM domain support.

Is that OK for you?

Yes, that is fine. I'll mark it as rejected.

Quoted 6 lines

BTW, changing

    -#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
    +#if defined(CONFIG_PM_RMOBILE) && !defined(CONFIG_ARCH_MULTIPLATFORM)

is fine for me, though, but I don't know it's worth the effort.

I don't think it is worth the noise it creates.

Quoted 74 lines
Quoted 55 lines
Quoted 55 lines

For the first part of the problem how about this update to Magnus's patch?

[PATCH v1.1] ARM: shmobile: r8a7740: Cleanup PM Kconfig usage

Simplify the r8a7740 PM code by using CONFIG_PM_RMOBILE instead of having a complex #if expression embedded in the C code.

[[email protected]: do not make r8a7740_init_pm_domains
out-of-line for !CONFIG_PM_RMOBILE case]

---
 arch/arm/mach-shmobile/pm-r8a7740.c | 4 ++--
 arch/arm/mach-shmobile/r8a7740.h    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-shmobile/pm-r8a7740.c +2 -2
index e3f1464..225be5e 100644
@@ -13,7 +13,7 @@
 #include "common.h"
 #include "pm-rmobile.h"
 
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_PM_RMOBILE
 static int r8a7740_pd_a4s_suspend(void)
 {
      /*
@@ -56,7 +56,7 @@ void __init r8a7740_init_pm_domains(void)
      rmobile_init_domains(r8a7740_pm_domains, ARRAY_SIZE(r8a7740_pm_domains));
      pm_genpd_add_subdomain_names("A4S", "A3SP");
 }
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#endif
 
 #ifdef CONFIG_SUSPEND
 static int r8a7740_enter_suspend(suspend_state_t suspend_state)
arch/arm/mach-shmobile/r8a7740.h +2 -2
index f369b4b..5ba292e 100644
@@ -53,10 +53,10 @@ extern void r8a7740_clock_init(u8 md_ck);
 extern void r8a7740_pinmux_init(void);
 extern void r8a7740_pm_init(void);
 
-#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
+#ifdef CONFIG_PM_RMOBILE
 extern void __init r8a7740_init_pm_domains(void);
 #else
 static inline void r8a7740_init_pm_domains(void) {}
-#endif /* CONFIG_PM && !CONFIG_ARCH_MULTIPLATFORM */
+#endif
 
Quoted 3 lines
Quoted 3 lines
arch/arm/mach-shmobile/r8a7740.h +0 -1
 #endif /* __ASM_R8A7740_H__ */
--

2.0.1

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html