linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: imx6q: Annotate imx6q_obtain_fixed_clk_hw with __init
@ 2019-06-18  2:24 Nathan Chancellor
  2019-06-18 13:42 ` Shawn Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2019-06-18  2:24 UTC (permalink / raw)
  To: Abel Vesa, Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer
  Cc: Nick Desaulniers, linux-kernel, clang-built-linux,
	NXP Linux Team, Pengutronix Kernel Team, Nathan Chancellor,
	Fabio Estevam, linux-clk, linux-arm-kernel

When building with clang, the following modpost warning occurs:

WARNING: vmlinux.o(.text+0x974dbc): Section mismatch in reference from
the function imx6q_obtain_fixed_clk_hw() to the function
.init.text:imx_obtain_fixed_clock_hw()
The function imx6q_obtain_fixed_clk_hw() references
the function __init imx_obtain_fixed_clock_hw().
This is often because imx6q_obtain_fixed_clk_hw lacks a __init
annotation or the annotation of imx_obtain_fixed_clock_hw is wrong.

imx6q_obtain_fixed_clk_hw is only used in imx6q_clocks_init, which is
marked __init so do that to imx6q_obtain_fixed_clk_hw to avoid this
warning.

Fixes: 992b703b5b38 ("clk: imx6q: Switch to clk_hw based API")
Link: https://github.com/ClangBuiltLinux/linux/issues/541
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/clk/imx/clk-imx6q.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
index 2caa71e91119..18914e0a1850 100644
--- a/drivers/clk/imx/clk-imx6q.c
+++ b/drivers/clk/imx/clk-imx6q.c
@@ -418,8 +418,9 @@ static void disable_anatop_clocks(void __iomem *anatop_base)
 	writel_relaxed(reg, anatop_base + CCM_ANALOG_PLL_VIDEO);
 }
 
-static struct clk_hw *imx6q_obtain_fixed_clk_hw(struct device_node *np,
-						const char *name, unsigned long rate)
+static struct clk_hw __init *imx6q_obtain_fixed_clk_hw(struct device_node *np,
+							const char *name,
+							unsigned long rate)
 {
 	struct clk *clk = of_clk_get_by_name(np, name);
 	struct clk_hw *hw;
-- 
2.22.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: imx6q: Annotate imx6q_obtain_fixed_clk_hw with __init
  2019-06-18  2:24 [PATCH] clk: imx6q: Annotate imx6q_obtain_fixed_clk_hw with __init Nathan Chancellor
@ 2019-06-18 13:42 ` Shawn Guo
  2019-06-18 14:40   ` Nathan Chancellor
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Guo @ 2019-06-18 13:42 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Abel Vesa, Stephen Boyd, Michael Turquette, Nick Desaulniers,
	linux-kernel, linux-clk, clang-built-linux, NXP Linux Team,
	Pengutronix Kernel Team, Fabio Estevam, Sascha Hauer,
	linux-arm-kernel

On Mon, Jun 17, 2019 at 07:24:05PM -0700, Nathan Chancellor wrote:
> When building with clang, the following modpost warning occurs:
> 
> WARNING: vmlinux.o(.text+0x974dbc): Section mismatch in reference from
> the function imx6q_obtain_fixed_clk_hw() to the function
> .init.text:imx_obtain_fixed_clock_hw()
> The function imx6q_obtain_fixed_clk_hw() references
> the function __init imx_obtain_fixed_clock_hw().
> This is often because imx6q_obtain_fixed_clk_hw lacks a __init
> annotation or the annotation of imx_obtain_fixed_clock_hw is wrong.
> 
> imx6q_obtain_fixed_clk_hw is only used in imx6q_clocks_init, which is
> marked __init so do that to imx6q_obtain_fixed_clk_hw to avoid this
> warning.
> 
> Fixes: 992b703b5b38 ("clk: imx6q: Switch to clk_hw based API")
> Link: https://github.com/ClangBuiltLinux/linux/issues/541
> Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Thanks for the patch, Nathan.  But we already queued up a patch [1]
from Arnd for that.

Shawn

[1] https://lkml.org/lkml/2019/6/17/317

> ---
>  drivers/clk/imx/clk-imx6q.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
> index 2caa71e91119..18914e0a1850 100644
> --- a/drivers/clk/imx/clk-imx6q.c
> +++ b/drivers/clk/imx/clk-imx6q.c
> @@ -418,8 +418,9 @@ static void disable_anatop_clocks(void __iomem *anatop_base)
>  	writel_relaxed(reg, anatop_base + CCM_ANALOG_PLL_VIDEO);
>  }
>  
> -static struct clk_hw *imx6q_obtain_fixed_clk_hw(struct device_node *np,
> -						const char *name, unsigned long rate)
> +static struct clk_hw __init *imx6q_obtain_fixed_clk_hw(struct device_node *np,
> +							const char *name,
> +							unsigned long rate)
>  {
>  	struct clk *clk = of_clk_get_by_name(np, name);
>  	struct clk_hw *hw;
> -- 
> 2.22.0
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: imx6q: Annotate imx6q_obtain_fixed_clk_hw with __init
  2019-06-18 13:42 ` Shawn Guo
@ 2019-06-18 14:40   ` Nathan Chancellor
  0 siblings, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2019-06-18 14:40 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Abel Vesa, Stephen Boyd, Michael Turquette, Nick Desaulniers,
	linux-kernel, linux-clk, clang-built-linux, NXP Linux Team,
	Pengutronix Kernel Team, Fabio Estevam, Sascha Hauer,
	linux-arm-kernel

On Tue, Jun 18, 2019 at 09:42:55PM +0800, Shawn Guo wrote:
> On Mon, Jun 17, 2019 at 07:24:05PM -0700, Nathan Chancellor wrote:
> > When building with clang, the following modpost warning occurs:
> > 
> > WARNING: vmlinux.o(.text+0x974dbc): Section mismatch in reference from
> > the function imx6q_obtain_fixed_clk_hw() to the function
> > .init.text:imx_obtain_fixed_clock_hw()
> > The function imx6q_obtain_fixed_clk_hw() references
> > the function __init imx_obtain_fixed_clock_hw().
> > This is often because imx6q_obtain_fixed_clk_hw lacks a __init
> > annotation or the annotation of imx_obtain_fixed_clock_hw is wrong.
> > 
> > imx6q_obtain_fixed_clk_hw is only used in imx6q_clocks_init, which is
> > marked __init so do that to imx6q_obtain_fixed_clk_hw to avoid this
> > warning.
> > 
> > Fixes: 992b703b5b38 ("clk: imx6q: Switch to clk_hw based API")
> > Link: https://github.com/ClangBuiltLinux/linux/issues/541
> > Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> 
> Thanks for the patch, Nathan.  But we already queued up a patch [1]
> from Arnd for that.
> 
> Shawn
> 
> [1] https://lkml.org/lkml/2019/6/17/317

Ugh, sorry for the noise, I should have done a search and seen if
someone had sent out a fix already.

Cheers,
Nathan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-18 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18  2:24 [PATCH] clk: imx6q: Annotate imx6q_obtain_fixed_clk_hw with __init Nathan Chancellor
2019-06-18 13:42 ` Shawn Guo
2019-06-18 14:40   ` Nathan Chancellor

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).