From: Stephen Boyd <sboyd@kernel.org>
To: Andy Gross <agross@kernel.org>, Arnd Bergmann <arnd@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Jerome Brunet <jbrunet@baylibre.com>,
Kevin Hilman <khilman@baylibre.com>,
Michael Turquette <mturquette@baylibre.com>,
Mike Turquette <mturquette@linaro.org>,
Neil Armstrong <narmstrong@baylibre.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Stephen Boyd <sboyd@codeaurora.org>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] clk: define to_clk_regmap() as inline function
Date: Wed, 28 Oct 2020 16:34:50 -0700 [thread overview]
Message-ID: <160392809056.884498.15602398724017724347@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <20201026161411.3708639-1-arnd@kernel.org>
Quoting Arnd Bergmann (2020-10-26 09:13:57)
> From: Arnd Bergmann <arnd@arndb.de>
>
> Nesting container_of() causes warnings with W=2, which is
> annoying if it happens in headers and fills the build log
> like:
>
> In file included from drivers/clk/qcom/clk-alpha-pll.c:6:
> drivers/clk/qcom/clk-alpha-pll.c: In function 'clk_alpha_pll_hwfsm_enable':
> include/linux/kernel.h:852:8: warning: declaration of '__mptr' shadows a previous local [-Wshadow]
> 852 | void *__mptr = (void *)(ptr); \
> | ^~~~~~
> drivers/clk/qcom/clk-alpha-pll.c:155:31: note: in expansion of macro 'container_of'
> 155 | #define to_clk_alpha_pll(_hw) container_of(to_clk_regmap(_hw), \
> | ^~~~~~~~~~~~
> drivers/clk/qcom/clk-regmap.h:27:28: note: in expansion of macro 'container_of'
> 27 | #define to_clk_regmap(_hw) container_of(_hw, struct clk_regmap, hw)
> | ^~~~~~~~~~~~
> drivers/clk/qcom/clk-alpha-pll.c:155:44: note: in expansion of macro 'to_clk_regmap'
> 155 | #define to_clk_alpha_pll(_hw) container_of(to_clk_regmap(_hw), \
> | ^~~~~~~~~~~~~
> drivers/clk/qcom/clk-alpha-pll.c:254:30: note: in expansion of macro 'to_clk_alpha_pll'
> 254 | struct clk_alpha_pll *pll = to_clk_alpha_pll(hw);
> | ^~~~~~~~~~~~~~~~
> include/linux/kernel.h:852:8: note: shadowed declaration is here
> 852 | void *__mptr = (void *)(ptr); \
> | ^~~~~~
>
> Redefine two copies of the to_clk_regmap() macro as inline functions
> to avoid a lot of these.
>
> Fixes: ea11dda9e091 ("clk: meson: add regmap clocks")
> Fixes: 085d7a455444 ("clk: qcom: Add a regmap type clock struct")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
Applied to clk-fixes
next prev parent reply other threads:[~2020-10-28 23:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 16:13 [PATCH] clk: define to_clk_regmap() as inline function Arnd Bergmann
2020-10-26 16:33 ` Jerome Brunet
2020-10-28 23:34 ` Stephen Boyd [this message]
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
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=160392809056.884498.15602398724017724347@swboyd.mtv.corp.google.com \
--to=sboyd@kernel.org \
--cc=agross@kernel.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=mturquette@baylibre.com \
--cc=mturquette@linaro.org \
--cc=narmstrong@baylibre.com \
--cc=sboyd@codeaurora.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).