1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
From: Seth Forshee <seth.forshee@canonical.com>
Date: Wed, 2 Aug 2017 15:42:50 -0500
Subject: Build fixes for Linux 4.13
__GFP_REPEAT was renamed to __GFP_RETRY_NOFAIL in 4.13, causing
build failures. Define __GFP_REPEAT to the new flag if the kernel
is 4.13 or later.
LP: #1706430
---
driver/ntoskernel.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/driver/ntoskernel.h b/driver/ntoskernel.h
index 9fc6c98..9c08f85 100644
--- a/driver/ntoskernel.h
+++ b/driver/ntoskernel.h
@@ -121,6 +121,11 @@ static cpumask_t cpumasks[NR_CPUS];
*/
#include <asm/dma-mapping.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0)
+/* __GFP_REPEAT renamed to ___GFP_RETRY_MAYFAIL in 4.13 */
+#define __GFP_REPEAT ___GFP_RETRY_MAYFAIL
+#endif
+
#define PCI_DMA_ALLOC_COHERENT(pci_dev,size,dma_handle) \
dma_alloc_coherent(&pci_dev->dev,size,dma_handle, \
GFP_KERNEL | __GFP_REPEAT)
|