lkml.org 
[lkml]   [2009]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH 09/10] HID: add compat support
From
On Fri, May 16, 2008 at 3:19 PM, Jiri Slaby <jirislaby@gmail.com> wrote:
> Add compat option to hid code to allow loading of all modules on
> systems which don't allow autoloading because of old userspace.
>
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> ---
> Documentation/feature-removal-schedule.txt | 7 +++++++
> drivers/hid/Kconfig | 11 +++++++++++
> drivers/hid/Makefile | 4 ++++
> drivers/hid/hid-apple.c | 2 ++
> drivers/hid/hid-core.c | 12 ++++++++++++
> drivers/hid/hid-dummy.c | 13 +++++++++++++
> drivers/hid/hid-logitech.c | 2 ++
> include/linux/hid.h | 17 +++++++++++++++--
> 8 files changed, 66 insertions(+), 2 deletions(-)
> create mode 100644 drivers/hid/hid-dummy.c
>

> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index c67e5fe..447aed9 100644
> --- a/include/linux/hid.h
> +++ b/include/linux/hid.h

> +#ifdef CONFIG_HID_COMPAT
> +#define HID_COMPAT_LOAD_DRIVER(name) \
> +void hid_compat_##name(void) { } \
> +EXPORT_SYMBOL(hid_compat_##name)
> +#else
> +#define HID_COMPAT_LOAD_DRIVER(name)
> +#endif /* HID_COMPAT */
> +#define HID_COMPAT_CALL_DRIVER(name) do { \
> + extern void hid_compat_##name(void); \
> + hid_compat_##name(); \
> +} while (0)
> +
> #endif
>

This leads to 3 headers_check warnings:

usr/include/linux/hid.h:66: leaks CONFIG_HID to userspace where it is not valid
usr/include/linux/hid.h:69: extern's make no sense in userspace
usr/include/linux/hid.h:76: extern's make no sense in userspace

So I am moving whole above block in #ifdef __KEREL__

If you have any objections, then let me know, now it will look like this:

#endif /* HID_FF */

+#ifdef __KERNEL__
#ifdef CONFIG_HID_COMPAT
#define HID_COMPAT_LOAD_DRIVER(name) \
/* prototype to avoid sparse warning */ \
@@ -804,6 +805,7 @@ EXPORT_SYMBOL(hid_compat_##name)
extern void hid_compat_##name(void); \
hid_compat_##name(); \
} while (0)
+#endif /* __KERNEL__ */

#endif

--
JSR


\
 
 \ /
  Last update: 2009-01-24 06:57    [W:0.104 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site