linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 4/6] clk: tegra: Add stubs needed for compile testing
Date: Mon, 4 Oct 2021 23:41:04 +0300	[thread overview]
Message-ID: <fe54d967-4fd0-5129-2d15-b1271490306a@gmail.com> (raw)
In-Reply-To: <YVtd67B0Ac+ChBEA@orome.fritz.box>

04.10.2021 23:02, Thierry Reding пишет:
> On Mon, Oct 04, 2021 at 09:33:57PM +0200, Thierry Reding wrote:
>> On Sun, Sep 12, 2021 at 11:29:05PM +0300, Dmitry Osipenko wrote:
>>> Add stubs needed for compile-testing of tegra-cpuidle driver.
>>>
>>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>>> ---
>>>  include/linux/clk/tegra.h | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
>>> index d128ad1570aa..9bd06d8a5436 100644
>>> --- a/include/linux/clk/tegra.h
>>> +++ b/include/linux/clk/tegra.h
>>> @@ -42,7 +42,11 @@ struct tegra_cpu_car_ops {
>>>  #endif
>>>  };
>>>  
>>> +#ifdef CONFIG_ARCH_TEGRA
>>>  extern struct tegra_cpu_car_ops *tegra_cpu_car_ops;
>>> +#else
>>> +static struct tegra_cpu_car_ops *tegra_cpu_car_ops __maybe_unused;
>>> +#endif
>>
>> Ugh... this one seems a bit over the top, to be honest. The only place
>> where this seems to be used is in arch/arm/mach-tegra/pm.c, but that
>> already uses one of the stubs from include/linux/clk/tegra.h, so I'm
>> wondering if we can't define that latter stub in a way to make it
>> unnecessary to declare this bogus pointer.
>>
>> I'll play around with this a little bit.
> 
> The below does the trick for me as well:
> 
> --- >8 ---
> diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
> index d128ad1570aa..d261db7e6060 100644
> --- a/include/linux/clk/tegra.h
> +++ b/include/linux/clk/tegra.h
> @@ -42,6 +42,7 @@ struct tegra_cpu_car_ops {
>  #endif
>  };
> 
> +#ifdef CONFIG_ARCH_TEGRA
>  extern struct tegra_cpu_car_ops *tegra_cpu_car_ops;
> 
>  static inline void tegra_wait_cpu_in_reset(u32 cpu)
> @@ -83,6 +84,27 @@ static inline void tegra_disable_cpu_clock(u32 cpu)
> 
>  	tegra_cpu_car_ops->disable_clock(cpu);
>  }
> +#else
> +static inline void tegra_wait_cpu_in_reset(u32 cpu)
> +{
> +}
> +
> +static inline void tegra_put_cpu_in_reset(u32 cpu)
> +{
> +}
> +
> +static inline void tegra_cpu_out_of_reset(u32 cpu)
> +{
> +}
> +
> +static inline void tegra_enable_cpu_clock(u32 cpu)
> +{
> +}
> +
> +static inline void tegra_disable_cpu_clock(u32 cpu)
> +{
> +}
> +#endif
> 
>  #ifdef CONFIG_PM_SLEEP
>  static inline bool tegra_cpu_rail_off_ready(void)
> --- >8 ---
> 
> Do you mind if I replace your version with that? I think that's a little
> bit cleaner because it should be easier for the compiler to completely
> compile it out.

I don't mind, please choose what you prefer more. This was one of the
first variants of this patch, it adds more lines and it won't be
compiled with ARCH_TEGRA=n and COMPILE_TEST=n anyways.

  reply	other threads:[~2021-10-04 20:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12 20:29 [PATCH v1 0/6] Tegra cpuidle driver fixes and improvements for 5.16 Dmitry Osipenko
2021-09-12 20:29 ` [PATCH v1 1/6] soc/tegra: fuse: Add stubs needed for compile testing Dmitry Osipenko
2021-09-12 20:29 ` [PATCH v1 2/6] soc/tegra: irq: " Dmitry Osipenko
2021-09-12 20:29 ` [PATCH v1 3/6] soc/tegra: pm: Make stubs usable " Dmitry Osipenko
2021-09-12 20:29 ` [PATCH v1 4/6] clk: tegra: Add stubs needed " Dmitry Osipenko
2021-10-04 19:33   ` Thierry Reding
2021-10-04 20:02     ` Thierry Reding
2021-10-04 20:41       ` Dmitry Osipenko [this message]
2021-09-12 20:29 ` [PATCH v1 5/6] cpuidle: tegra: Enable " Dmitry Osipenko
2021-09-27 16:33   ` Dmitry Osipenko
2021-09-29 10:32     ` Daniel Lezcano
2021-09-12 20:29 ` [PATCH v1 6/6] cpuidle: tegra: Check whether PMC is ready Dmitry Osipenko

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=fe54d967-4fd0-5129-2d15-b1271490306a@gmail.com \
    --to=digetx@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=thierry.reding@gmail.com \
    /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).