Skip to contentSkip to conversation

use "#ifdef __KERNEL" to avoid compile error in input.h

PATCH Luke Yang 1 participant 1 message Apr 7, 2006 1 message not in the archive

lore
Share & tools
lore

Luke Yang

author
#1 lore raw
In reply to a message not in the archive
Quoted 23 lines · Andrew Morton

Hi all,

In linux/input.h, struct input_device_id uses type kernel_ulong_t,
which is defined in linux/mod_devicetable.h, but which is only included when __KERNEL__ is defined. So struct input_device_id should also be exported only in kernel mode.

include/linux/input.h +1 -0
index b0e612d..0319b65 100644
@@ -805,6 +805,7 @@ #define FF_AUTOCENTER       0x61
 
 #define FF_MAX         0x7f
 
+#ifdef __KERNEL__
 struct input_device_id {
 
        kernel_ulong_t flags;

include/linux/input.h struct input_device_id { · line 830

Quoted 7 lines
include/linux/input.h +1 -0
@@ -823,6 +824,7 @@ struct input_device_id {
 
        kernel_ulong_t driver_info;
 };
+#endif
 
 /*
  * Structure for hotplug & device<->driver matching.

Ooops, there is problem with the patch. The script/mod/file2alias.c
need the struct input_device_id, and it defines the "kernel_ulong_t" by itself... Dmitry, any thought on how to solve the problem?

--
Best regards,
Luke Yang
[email protected]