From 871f61738e440af7372eb5de063dda8198728eef Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 1 Oct 2024 15:35:57 -0400 Subject: [PATCH] move asm/unaligned.h to linux/unaligned.h asm/unaligned.h is always an include of asm-generic/unaligned.h; might as well move that thing to linux/unaligned.h and include that - there's nothing arch-specific in that header. auto-generated by the following: for i in `git grep -l -w asm/unaligned.h`; do sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i done for i in `git grep -l -w asm-generic/unaligned.h`; do sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i done git mv include/asm-generic/unaligned.h include/linux/unaligned.h git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h [jason.gerecke@wacom.com: Imported into input-wacom (5f60d5f6bbc1)] Signed-off-by: Jason Gerecke --- .github/workflows/main.yml | 5 ++++- 4.18/wacom.h | 4 ++++ 4.18/wacom_i2c.c | 4 ++++ configure.ac | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c9bad70..316bb337 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - kernel: ["6.10", "6.3", "5.15", "5.10", "5.4", "5.0", "4.19"] + kernel: ["6.12", "6.10", "6.3", "5.15", "5.10", "5.4", "5.0", "4.19"] include: - kernel: "4.19" compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign @@ -30,6 +30,9 @@ jobs: - kernel: "6.10" compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign build_makeflags: KBUILD_MODPOST_WARN=1 + - kernel: "6.12" + compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign + build_makeflags: KBUILD_MODPOST_WARN=1 steps: - name: Install dependencies run: | diff --git a/4.18/wacom.h b/4.18/wacom.h index 792bec17..43ae0734 100644 --- a/4.18/wacom.h +++ b/4.18/wacom.h @@ -90,7 +90,11 @@ #include #include #include +#ifdef WACOM_LINUX_UNALIGNED +#include +#else #include +#endif #include /* diff --git a/4.18/wacom_i2c.c b/4.18/wacom_i2c.c index 10aebd3b..9830499c 100644 --- a/4.18/wacom_i2c.c +++ b/4.18/wacom_i2c.c @@ -14,7 +14,11 @@ #include #include #include +#ifdef WACOM_LINUX_UNALIGNED +#include +#else #include +#endif #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0) diff --git a/configure.ac b/configure.ac index c37ae11d..aba933e2 100644 --- a/configure.ac +++ b/configure.ac @@ -272,6 +272,21 @@ int test(struct led_trigger *trigger) { return trigger->brightness; } AC_MSG_RESULT([no]) ]) +dnl Check if unaligned.h has been moved to linux/. This should be in Linux +dnl 6.12 and later. +AC_MSG_CHECKING(for linux/unaligned.h) +WACOM_LINUX_TRY_COMPILE([ +#include +],[ +],[ + HAVE_LINUX_UNALIGNED=yes + AC_MSG_RESULT([yes]) + AC_DEFINE([WACOM_LINUX_UNALIGNED], [], [kernel defines linux/unaligned.h v6.12+]) +],[ + HAVE_LINUX_UNALIGNED=no + AC_MSG_RESULT([no]) +]) + dnl Check which version of the driver we should compile