public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: imx: Annotate imx7d_enet_init() as __init
@ 2024-08-23  0:05 Nathan Chancellor
  2024-08-23  9:20 ` Peng Fan
  2024-09-01  7:36 ` Shawn Guo
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2024-08-23  0:05 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel, imx, llvm, patches, Nathan Chancellor

After a recent LLVM change [1] that deduces __cold on functions that
only call cold code (such as __init functions), there is a section
mismatch warning from imx7d_enet_init(), which got moved to
.text.unlikely. as a result of that optimization:

  WARNING: modpost: vmlinux: section mismatch in reference: imx7d_enet_init+0x20 (section: .text.unlikely.) -> imx7d_enet_clk_sel (section: .init.text)

Drop the inline keyword (which does not guarantee inlining) and replace
it with __init, as imx7d_enet_init() is only called from __init code,
which clears up the warning.

Link: https://github.com/llvm/llvm-project/commit/6b11573b8c5e3d36beee099dbe7347c2a007bf53 [1]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/arm/mach-imx/mach-imx7d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/mach-imx7d.c b/arch/arm/mach-imx/mach-imx7d.c
index 9587885fb1ac..87632ae0201c 100644
--- a/arch/arm/mach-imx/mach-imx7d.c
+++ b/arch/arm/mach-imx/mach-imx7d.c
@@ -48,7 +48,7 @@ static void __init imx7d_enet_clk_sel(void)
 	}
 }
 
-static inline void imx7d_enet_init(void)
+static void __init imx7d_enet_init(void)
 {
 	imx7d_enet_phy_init();
 	imx7d_enet_clk_sel();

---
base-commit: 47ac09b91befbb6a235ab620c32af719f8208399
change-id: 20240822-imx7d-mark-imx7d_enet_init-as-init-03d0c38e3118

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>



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

* RE: [PATCH] ARM: imx: Annotate imx7d_enet_init() as __init
  2024-08-23  0:05 [PATCH] ARM: imx: Annotate imx7d_enet_init() as __init Nathan Chancellor
@ 2024-08-23  9:20 ` Peng Fan
  2024-09-01  7:36 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Peng Fan @ 2024-08-23  9:20 UTC (permalink / raw)
  To: Nathan Chancellor, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam
  Cc: linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
	llvm@lists.linux.dev, patches@lists.linux.dev

> Subject: [PATCH] ARM: imx: Annotate imx7d_enet_init() as __init
> 
> After a recent LLVM change [1] that deduces __cold on functions that
> only call cold code (such as __init functions), there is a section
> mismatch warning from imx7d_enet_init(), which got moved
> to .text.unlikely. as a result of that optimization:
> 
>   WARNING: modpost: vmlinux: section mismatch in reference:
> imx7d_enet_init+0x20 (section: .text.unlikely.) -> imx7d_enet_clk_sel
> (section: .init.text)
> 
> Drop the inline keyword (which does not guarantee inlining) and
> replace it with __init, as imx7d_enet_init() is only called from __init
> code, which clears up the warning.
> 
> Link:
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Reviewed-by: Peng Fan <peng.fan@nxp.com>


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

* Re: [PATCH] ARM: imx: Annotate imx7d_enet_init() as __init
  2024-08-23  0:05 [PATCH] ARM: imx: Annotate imx7d_enet_init() as __init Nathan Chancellor
  2024-08-23  9:20 ` Peng Fan
@ 2024-09-01  7:36 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2024-09-01  7:36 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	linux-arm-kernel, imx, llvm, patches

On Thu, Aug 22, 2024 at 05:05:17PM -0700, Nathan Chancellor wrote:
> After a recent LLVM change [1] that deduces __cold on functions that
> only call cold code (such as __init functions), there is a section
> mismatch warning from imx7d_enet_init(), which got moved to
> .text.unlikely. as a result of that optimization:
> 
>   WARNING: modpost: vmlinux: section mismatch in reference: imx7d_enet_init+0x20 (section: .text.unlikely.) -> imx7d_enet_clk_sel (section: .init.text)
> 
> Drop the inline keyword (which does not guarantee inlining) and replace
> it with __init, as imx7d_enet_init() is only called from __init code,
> which clears up the warning.
> 
> Link: https://github.com/llvm/llvm-project/commit/6b11573b8c5e3d36beee099dbe7347c2a007bf53 [1]
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Applied, thanks!



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

end of thread, other threads:[~2024-09-01  7:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23  0:05 [PATCH] ARM: imx: Annotate imx7d_enet_init() as __init Nathan Chancellor
2024-08-23  9:20 ` Peng Fan
2024-09-01  7:36 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox