TL;DR
I get Kernelheaders with the correct version number but function definitions that were only introduced some kernel versions later. How do I get rid of these definition from the future?
Background
I have been writing a kernelmodule and noted that it did not compile on another machine with the error that pci_bus_address
was not defined. A quick investigation yielded, that it should not be defined since it is running a 3.10 Kernel, and this function is only available since 3.14.
I figured that a quick #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
block should fix the issue. However, my host machine is running a 3.10 Kernel as well.
Why do my kernel-headers know about a function, that should only be defined in a later version of the kernel? How can I get correct Kernel headers, that do not include this function?
I ran repoquery -i kernel-devel
to show the installed version:
Name : kernel-devel
Version : 3.10.0
Release : 327.18.2.el7
Architecture: x86_64
Size : 34442356
Packager : None
Group : System Environment/Kernel
URL : http://www.kernel.org/
Repository : updates
Summary : Development package for building kernel modules to match the kernel
Source : kernel-3.10.0-327.18.2.el7.src.rpm
Description :
This package provides kernel headers and makefiles sufficient to build modules
against the kernel package.
however running grep pci_bus_addr /usr/src/kernels/3.10.0-327.18.2.el7.x86_64/include/linux/pci.h
returns static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar)