[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <160392809056.884498.15602398724017724347@swboyd.mtv.corp.google.com>
Date: Wed, 28 Oct 2020 16:34:50 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Andy Gross <agross@...nel.org>, Arnd Bergmann <arnd@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Jerome Brunet <jbrunet@...libre.com>,
Kevin Hilman <khilman@...libre.com>,
Michael Turquette <mturquette@...libre.com>,
Mike Turquette <mturquette@...aro.org>,
Neil Armstrong <narmstrong@...libre.com>
Cc: Arnd Bergmann <arnd@...db.de>, Stephen Boyd <sboyd@...eaurora.org>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
linux-amlogic@...ts.infradead.org, linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH] clk: define to_clk_regmap() as inline function
Quoting Arnd Bergmann (2020-10-26 09:13:57)
> From: Arnd Bergmann <arnd@...db.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@...db.de>
> ---
Applied to clk-fixes
Powered by blists - more mailing lists