diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h index 10fc418..22ef968 100644 --- a/kernel/common/inc/nv-linux.h +++ b/kernel/common/inc/nv-linux.h @@ -175,7 +175,11 @@ static inline uid_t __kuid_val(kuid_t uid) #if defined(NV_VM_INSERT_PAGE_PRESENT) #include +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) #include +#else +#include +#endif #endif #if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64) @@ -1209,7 +1213,7 @@ static inline NvU32 nv_alloc_init_flags(int cached, int contiguous, int zeroed) static inline NvBool nv_dma_maps_swiotlb(struct pci_dev *dev) { NvBool swiotlb_in_use = NV_FALSE; -#if defined(CONFIG_SWIOTLB) +#if defined(CONFIG_SWIOTLB) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) #if defined(NV_DMA_OPS_PRESENT) || defined(NV_GET_DMA_OPS_PRESENT) /* * We only use the 'dma_ops' symbol on older x86_64 kernels; later kernels, diff --git a/kernel/conftest.sh b/kernel/conftest.sh index b23dbb4..42dc576 100755 --- a/kernel/conftest.sh +++ b/kernel/conftest.sh @@ -1906,7 +1906,12 @@ compile_test() { # Determine if the phys_to_dma function is present. # CODE=" + #include +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) #include +#else + #include +#endif void conftest_phys_to_dma(void) { phys_to_dma(); }"