All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
To: Danish Khateeb <danishkhateeb03@gmail.com>
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org,
	 andriy.shevchenko@linux.intel.com, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org,  linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] serial: 8250: Fix section mismatch with CONFIG_MODULES=n
Date: Sat, 26 Sep 2026 19:40:03 +0200	[thread overview]
Message-ID: <argClwhgQyMkeq29@monoceros> (raw)
In-Reply-To: <20260926163506.487201-1-danishkhateeb03@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

Hello Danish,

On Sat, Sep 26, 2026 at 11:35:06AM -0500, Danish Khateeb wrote:
> Without CONFIG_MODULES, __init_or_module means __init, so
> serial8250_pnp_exit() and serial8250_hub6_exit() end up in .init.text.
> They are also called from serial8250_exit(), which is __exit, and
> modpost warns:
> 
>   WARNING: modpost: vmlinux: section mismatch in reference: serial8250_exit+0x2a (section: .exit.text) -> serial8250_pnp_exit (section: .init.text)

Isn't that a false positive because with CONFIG_MODULES=n .exit is
discarded and so the section mismatch doesn't matter?

> The exit code never runs in such a kernel, so nothing breaks at runtime.

Ah, you found that, too.

> But a function that is called from both __init and __exit code can't
> carry either annotation, so drop it.

I thought __init_or_module was the right annotation ...

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2026-09-26 17:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26 16:35 [PATCH] serial: 8250: Fix section mismatch with CONFIG_MODULES=n Danish Khateeb
2026-09-26 16:42 ` sashiko-bot
2026-09-26 17:40 ` Uwe Kleine-König [this message]
2026-09-27 14:00   ` Danish Khateeb

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=argClwhgQyMkeq29@monoceros \
    --to=u.kleine-koenig@baylibre.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=danishkhateeb03@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.