From a3d53ad5629c04671e1dfda0871d276087213672 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Mon, 12 Feb 2018 21:57:04 +0100 Subject: [PATCH] dahdi-linux: include linux/uaccess.h rather than asm/uaccess.h Starting with 4.12 there are module build errors due to the arch-specific uaccess.h using a macro defined in the generic include. The generic include has been around since 2.6.18 and has always included asm/uaccess.h, so switch to using the generic include for all kernels which have it. Example build failure: CC [M] /data/bowl-builder/mips64_octeon/build/sdk/build_dir/target-mips64_octeon_64_musl/linux-octeon/dahdi-linux-2.11.1-20180111/drivers/dahdi/wcb4xxp/base.o In file included from ../dahdi-linux-2.11.1-20180111/drivers/dahdi/wcb4xxp/base.c:38:0: ./arch/mips/include/asm/uaccess.h: In function 'eva_kernel_access': ./arch/mips/include/asm/uaccess.h:91:9: error: implicit declaration of function 'uaccess_kernel' [-Werror=implicit-function-declaration] return uaccess_kernel(); ^ cc1: some warnings being treated as errors The same can currently be seen on arc_archs where also kernel 4.14.18 is used. The patch just follows what Ubuntu's Seth Forshee suggested for openafs, which ran into the same problem. The commit message is largely just copied from Seth's commit message as well :) The issue has been reported to upstream here: https://issues.asterisk.org/jira/browse/DAHLIN-360 The same patch has been uploaded there. Signed-off-by: Sebastian Kemper --- .../patches/110-fix-uaccess_h-include.patch | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 libs/dahdi-linux/patches/110-fix-uaccess_h-include.patch diff --git a/libs/dahdi-linux/patches/110-fix-uaccess_h-include.patch b/libs/dahdi-linux/patches/110-fix-uaccess_h-include.patch new file mode 100644 index 0000000..5357fa7 --- /dev/null +++ b/libs/dahdi-linux/patches/110-fix-uaccess_h-include.patch @@ -0,0 +1,77 @@ +--- a/drivers/dahdi/datamods/syncppp.c ++++ b/drivers/dahdi/datamods/syncppp.c +@@ -39,6 +39,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -56,7 +57,11 @@ + #include + + #include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + #include ++#else ++#include ++#endif + + #define MAXALIVECNT 6 /* max. alive packets */ + +--- a/drivers/dahdi/wcb4xxp/base.c ++++ b/drivers/dahdi/wcb4xxp/base.c +@@ -22,6 +22,7 @@ + + #include + ++#include + #include /* printk() */ + #include /* error codes */ + #include +@@ -35,7 +36,11 @@ + #include + #include /* dev_err() */ + #include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + #include /* copy_*_user */ ++#else ++#include ++#endif + #include /* work_struct */ + #include /* timer_struct */ + #include +--- a/drivers/dahdi/xpp/mmapdrv.c ++++ b/drivers/dahdi/xpp/mmapdrv.c +@@ -1,3 +1,4 @@ ++#include + #include + #include + #include +@@ -10,7 +11,11 @@ + #include + #include + #include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + #include ++#else ++#include ++#endif + #include + #include "mmapbus.h" + #include "xbus-core.h" +--- a/drivers/dahdi/xpp/xpp_usb.c ++++ b/drivers/dahdi/xpp/xpp_usb.c +@@ -27,7 +27,11 @@ + #include + #include /* for udelay */ + #include ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) + #include ++#else ++#include ++#endif + #include + #include + #include -- 2.30.2