From: Nathan Chancellor <nathan@kernel.org>
To: Luca Leonardo Scorcia <l.scorcia@gmail.com>
Cc: linux-mediatek@lists.infradead.org,
kernel test robot <lkp@intel.com>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Thomas Gleixner <tglx@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev
Subject: Re: [PATCH] clocksource/drivers/timer-mediatek: Fix "no-cfi indirect call" warning
Date: Sun, 1 Nov 2026 15:40:08 -0700 [thread overview]
Message-ID: <20261101224008.GA910831@ax162> (raw)
In-Reply-To: <20261101095538.1046918-1-l.scorcia@gmail.com>
On Sun, Nov 01, 2026 at 10:55:31AM +0100, Luca Leonardo Scorcia wrote:
> After converting the driver to OF probing, kernel-test-robot reported the
> following new warning:
>
> vmlinux.o: warning: objtool: mtk_timer_probe+0x23: no-cfi indirect call!
>
> This occurs because of_device_get_match_data() returns NULL when
> CONFIG_OF is disabled, which results in LLVM dropping the kCFI setup
> since it knows that there is no valid target for this call. Adding a
> check for a NULL timer_init avoids the warning and it makes the probe
> more robust since of_device_get_match_data() could return NULL even
> when CONFIG_OF=y.
>
> Fixes: 7a097aba7255 ("clocksource/drivers/timer-mediatek: Convert to OF probing")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202610290223.iOEGeDs2-lkp@intel.com/
> Suggested-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
> drivers/clocksource/timer-mediatek.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/clocksource/timer-mediatek.c b/drivers/clocksource/timer-mediatek.c
> index 842d6ee4259e..e772f5fe8742 100644
> --- a/drivers/clocksource/timer-mediatek.c
> +++ b/drivers/clocksource/timer-mediatek.c
> @@ -353,6 +353,9 @@ static int mtk_timer_probe(struct platform_device *pdev)
> int (*timer_init)(struct platform_device *pdev);
>
> timer_init = of_device_get_match_data(&pdev->dev);
> + if (!timer_init)
> + return -ENODEV;
> +
> return timer_init(pdev);
> }
>
> --
> 2.43.0
>
--
Cheers,
Nathan
prev parent reply other threads:[~2026-11-01 22:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 9:55 Luca Leonardo Scorcia
2026-11-01 22:40 ` Nathan Chancellor [this message]
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=20261101224008.GA910831@ax162 \
--to=nathan@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=daniel.lezcano@kernel.org \
--cc=justinstitt@google.com \
--cc=l.scorcia@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=matthias.bgg@gmail.com \
--cc=morbo@google.com \
--cc=ndesaulniers@google.com \
--cc=tglx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®