diff mbox

[v2,1/2] update-linux-headers: Rename SW_MAX to SW_MAX_

Message ID 1444320700-26260-2-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster Oct. 8, 2015, 4:11 p.m. UTC
The next commit will compile hw/input/virtio-input.c and
hw/input/virtio-input-hid.c even when CONFIG_LINUX is off.  These
files include both "include/standard-headers/linux/input.h" and
<windows.h> then.  Doesn't work, because both define SW_MAX.  We don't
actually use it.  Patch input.h to define SW_MAX_ instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/standard-headers/linux/input.h | 4 ++--
 scripts/update-linux-headers.sh        | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Gerd Hoffmann Oct. 9, 2015, 8:48 a.m. UTC | #1
On Do, 2015-10-08 at 18:11 +0200, Markus Armbruster wrote:
> The next commit will compile hw/input/virtio-input.c and
> hw/input/virtio-input-hid.c even when CONFIG_LINUX is off.  These
> files include both "include/standard-headers/linux/input.h" and
> <windows.h> then.  Doesn't work, because both define SW_MAX.  We don't
> actually use it.  Patch input.h to define SW_MAX_ instead.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
diff mbox

Patch

diff --git a/include/standard-headers/linux/input.h b/include/standard-headers/linux/input.h
index b003c67..43f1850 100644
--- a/include/standard-headers/linux/input.h
+++ b/include/standard-headers/linux/input.h
@@ -887,8 +887,8 @@  struct input_keymap_entry {
 #define SW_ROTATE_LOCK		0x0c  /* set = rotate locked/disabled */
 #define SW_LINEIN_INSERT	0x0d  /* set = inserted */
 #define SW_MUTE_DEVICE		0x0e  /* set = device disabled */
-#define SW_MAX			0x0f
-#define SW_CNT			(SW_MAX+1)
+#define SW_MAX_			0x0f
+#define SW_CNT			(SW_MAX_+1)
 
 /*
  * Misc events
diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index 11076191..457ef37 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -53,6 +53,7 @@  cp_portable() {
         -e 's/__attribute__((packed))/QEMU_PACKED/' \
         -e 's/__inline__/inline/' \
         -e '/sys\/ioctl.h/d' \
+        -e 's/SW_MAX/SW_MAX_/' \
         "$f" > "$to/$header";
 }