I faced exactly the same issue than rafdre.
In my case the [uname -r] command and the file /usr/src/linux/version where providing different versions values. I solved the issue via a global system update [pacman -Syu] and re-run [makepkg -si]
Hope it helps
Pinned Comments
JerryXiao commented on 2022-10-13 03:51 (UTC) (edited on 2022-10-14 02:44 (UTC) by JerryXiao)
For testing users, contributors: check out https://github.com/archlinux-jerry/nvidia-340xx
Warning: force push may happen to match the aur tree