Skip to contentSkip to conversation

clk: imx6q: Annotate imx6q_obtain_fixed_clk_hw with __init

PATCH In review Nathan Chancellor 2 participants 3 messages Jun 18, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: imx6q: Annotate imx6q_obtain_fixed_clk_hw with __init

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")
---
 drivers/clk/imx/clk-imx6q.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/clk/imx/clk-imx6q.c +3 -2
index 2caa71e91119..18914e0a1850 100644
@@ -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;
Signature · 1 line
2.22.0
#1 lore raw
Quoted 10 lines · Nathan Chancellor

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.

Quoted 8 lines

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

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

Quoted 23 lines
---
 drivers/clk/imx/clk-imx6q.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/clk/imx/clk-imx6q.c +3 -2
index 2caa71e91119..18914e0a1850 100644
@@ -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;
Signature · 1 line
2.22.0
#2 lore raw
Quoted 20 lines · Shawn Guo
Quoted 10 lines · Nathan Chancellor

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.

Quoted 8 lines

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")
Quoted 6 lines

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