[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080511211839.GA1641@uranus.ravnborg.org>
Date: Sun, 11 May 2008 23:18:39 +0200
From: Sam Ravnborg <sam@...nborg.org>
To: Jiri Slaby <jirislaby@...il.com>
Cc: Jiri Kosina <jkosina@...e.cz>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-input@...r.kernel.org, marcel@...tmann.org,
linux-kernel@...r.kernel.org, anssi.hannula@...il.com,
akpm@...ux-foundation.org
Subject: Re: [PATCH 9/9] HID: add compat support
On Sun, May 11, 2008 at 11:07:08PM +0200, Jiri Slaby wrote:
> On 05/11/2008 10:48 PM, Sam Ravnborg wrote:
> >On Sun, May 11, 2008 at 10:00:43PM +0200, Jiri Slaby wrote:
> >>diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
> >>index 8a5cbbe..c5bca8f 100644
> >>--- a/drivers/hid/Makefile
> >>+++ b/drivers/hid/Makefile
> >>@@ -15,3 +15,25 @@ obj-$(CONFIG_USB_HID) += usbhid/
> >> obj-$(CONFIG_USB_MOUSE) += usbhid/
> >> obj-$(CONFIG_USB_KBD) += usbhid/
> >>
> >>+targets := hid-dummy.h
> >>+
> >>+ifdef CONFIG_HID_COMPAT
> >>+
> >>+obj-m += hid-dummy.o
> >>+
> >>+$(srctree)/$(src)/hid-dummy.c: $(obj)/hid-dummy.h
> >>+
> >>+$(obj)/hid-dummy.h: $(filter-out
> >>$(srctree)/drivers/hid/hid-dummy.c,$(wildcard $(srctree)/drivers/hid/*.c))
> >>+ @echo -e 'static void __always_inline hid_dummy_load(void)\n{' > $@
> >>+ @FUNS=`grep -h 'HID_COMPAT_LOAD_DRIVER(' $(srctree)/drivers/hid/*.c
> >>| \
> >>+ sed -e 's/HID_COMPAT_LOAD_DRIVER( *\([^ ]*\) *) *;/\1/'`; \
> >>+ for FUN in $$FUNS; do \
> >>+ echo -e "\textern void hid_compat_$$FUN(void);"; \
> >>+ done >> $@; \
> >>+ echo >> $@; \
> >>+ for FUN in $$FUNS; do \
> >>+ echo -e "\thid_compat_$$FUN();"; \
> >>+ done >> $@
> >>+ @echo "}" >> $@
> >
> >I would prefer to see this done explicit in favour of some magic
> >makefile fragment as the above.
> >It is much simpler to understand if done explicit.
> >And it is not like we are talking 10 or 50 files here.
>
> Sorry, I don't understand you at all. Could you re-formulate what do you
> want to see rather than this? Maybe an example would be good.
The code above generates the file hid-dummy.h based on
the HID_COMPAT_LOAD_DRIVER(*) text in a few .c files.
So what I try to say is that we should replace the above with
a hid-dummy.h file that is handedited.
We could stick a few comments in the .h file explaining the usage too.
Or maybe I'm just confused and misunderstood what the code does?
Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists