Re: vmlinux.o: warning: objtool: mtk_timer_probe+0x23: no-cfi indirect call!
From: Nathan Chancellor
Date: Wed Oct 28 2026 - 16:24:13 EST
On Thu, Oct 29, 2026 at 03:10:30AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 65ba8f34ec886ec72b2c07ddc8cf3d815c32869d
> commit: 7a097aba725501c399b5e93d0199aa3a2f6e9c88 clocksource/drivers/timer-mediatek: Convert to OF probing
> date: 2 weeks ago
> config: x86_64-buildonly-randconfig-1001-20261028 (https://download.01.org/0day-ci/archive/20261029/202610290223.iOEGeDs2-lkp@xxxxxxxxx/config)
> compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261029/202610290223.iOEGeDs2-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Fixes: 7a097aba7255 ("clocksource/drivers/timer-mediatek: Convert to OF probing")
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202610290223.iOEGeDs2-lkp@xxxxxxxxx/
>
> All warnings (new ones prefixed by >>):
>
> >> vmlinux.o: warning: objtool: mtk_timer_probe+0x23: no-cfi indirect call!
This warning occurs as a result of the above change 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, which would probably be more robust anyways since
of_device_get_match_data() could return NULL even with CONFIG_OF=y?
diff --git a/drivers/clocksource/timer-mediatek.c b/drivers/clocksource/timer-mediatek.c
index 842d6ee4259e..33bf4c97bb77 100644
--- a/drivers/clocksource/timer-mediatek.c
+++ b/drivers/clocksource/timer-mediatek.c
@@ -353,6 +353,8 @@ 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);
}
--
Cheers,
Nathan