Skip to content

Commit

Permalink
move asm/unaligned.h to linux/unaligned.h
Browse files Browse the repository at this point in the history
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

[[email protected]: Imported into input-wacom (5f60d5f6bbc1)]
Signed-off-by: Jason Gerecke <[email protected]>
  • Loading branch information
Al Viro authored and jigpu committed Jan 14, 2025
1 parent 5f60a3c commit 2affa20
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 4.18/wacom.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@
#include <linux/usb/input.h>
#include <linux/power_supply.h>
#include <linux/timer.h>
#ifdef WACOM_LINUX_UNALIGNED
#include <linux/unaligned.h>
#else
#include <asm/unaligned.h>
#endif
#include <linux/version.h>

/*
Expand Down
4 changes: 4 additions & 0 deletions 4.18/wacom_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
#include <linux/slab.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#ifdef WACOM_LINUX_UNALIGNED
#include <linux/unaligned.h>
#else
#include <asm/unaligned.h>
#endif
#include <linux/version.h>

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,19,0)
Expand Down
15 changes: 15 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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 <linux/unaligned.h>
],[
],[
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
Expand Down

0 comments on commit 2affa20

Please sign in to comment.