linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] ARM: shmobile: r8a7740: Cleanup PM Kconfig usage
Date: Tue, 30 Sep 2014 07:12:24 +0000	[thread overview]
Message-ID: <CAMuHMdVBfgM_h2tgAW+is5HsAxpuQw4qVxj7Ziw_gHu1G61CfA@mail.gmail.com> (raw)
In-Reply-To: <20140904033942.22881.84361.sendpatchset@w520>

Hi Simon, Magnus,

On Tue, Sep 30, 2014 at 6:25 AM, Simon Horman <horms@verge.net.au> wrote:
> On Wed, Sep 24, 2014 at 09:54:49AM +0900, Simon Horman wrote:
>> On Thu, Sep 04, 2014 at 08:31:45AM +0200, Geert Uytterhoeven wrote:
>> > On Thu, Sep 4, 2014 at 5:39 AM, Magnus Damm <magnus.damm@gmail.com> wrote:
>> > > @@ -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)
>> > > --- 0001/arch/arm/mach-shmobile/r8a7740.h
>> > > +++ work/arch/arm/mach-shmobile/r8a7740.h       2014-09-04 12:29:12.000000000 +0900
>> > > @@ -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__ */
>> >
>> > 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
>>
>> 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.

>> 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.
>>
>> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>> [horms+renesas@verge.net.au: do not make r8a7740_init_pm_domains
>>  out-of-line for !CONFIG_PM_RMOBILE case]
>> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>> ---
>>  arch/arm/mach-shmobile/pm-r8a7740.c | 4 ++--
>>  arch/arm/mach-shmobile/r8a7740.h    | 4 ++--
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/mach-shmobile/pm-r8a7740.c b/arch/arm/mach-shmobile/pm-r8a7740.c
>> index e3f1464..225be5e 100644
>> --- a/arch/arm/mach-shmobile/pm-r8a7740.c
>> +++ b/arch/arm/mach-shmobile/pm-r8a7740.c
>> @@ -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)
>> diff --git a/arch/arm/mach-shmobile/r8a7740.h b/arch/arm/mach-shmobile/r8a7740.h
>> index f369b4b..5ba292e 100644
>> --- a/arch/arm/mach-shmobile/r8a7740.h
>> +++ b/arch/arm/mach-shmobile/r8a7740.h
>> @@ -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__ */
>> --
>> 2.0.1

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

  parent reply	other threads:[~2014-09-30  7:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04  3:39 [PATCH] ARM: shmobile: r8a7740: Cleanup PM Kconfig usage Magnus Damm
2014-09-04  4:12 ` Simon Horman
2014-09-04  4:17 ` Magnus Damm
2014-09-04  4:25 ` Simon Horman
2014-09-04  4:29 ` Simon Horman
2014-09-04  6:31 ` Geert Uytterhoeven
2014-09-24  0:54 ` Simon Horman
2014-09-30  4:25 ` Simon Horman
2014-09-30  7:12 ` Geert Uytterhoeven [this message]
2014-09-30  8:11 ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdVBfgM_h2tgAW+is5HsAxpuQw4qVxj7Ziw_gHu1G61CfA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).