linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, marcel@holtmann.org,
	linux-kernel@vger.kernel.org, anssi.hannula@gmail.com,
	akpm@linux-foundation.org
Subject: Re: [PATCH 9/9] HID: add compat support
Date: Sun, 11 May 2008 23:18:39 +0200	[thread overview]
Message-ID: <20080511211839.GA1641@uranus.ravnborg.org> (raw)
In-Reply-To: <48275FFC.9060305@gmail.com>

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



  reply	other threads:[~2008-05-11 21:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-11 20:00 [PATCH 1/9] modpost: add support for hid Jiri Slaby
2008-05-11 20:00 ` [PATCH 2/9] HID: make a bus from hid code Jiri Slaby
2008-05-11 20:00   ` [PATCH 3/9] HID: hid, make parsing event driven Jiri Slaby
2008-05-11 20:00     ` [PATCH 4/9] HID: move ids into separate file Jiri Slaby
2008-05-11 20:00       ` [PATCH 5/9] HID: move usage input mapping to hid.h Jiri Slaby
2008-05-11 20:00         ` [PATCH 6/9] HID: move logitech report quirks Jiri Slaby
2008-05-11 20:00           ` [PATCH 7/9] HID: move ignore quirks Jiri Slaby
2008-05-11 20:00             ` [PATCH 8/9] HID: move apple quirks Jiri Slaby
2008-05-11 20:00               ` [PATCH 9/9] HID: add compat support Jiri Slaby
2008-05-11 20:48                 ` Sam Ravnborg
2008-05-11 21:07                   ` Jiri Slaby
2008-05-11 21:18                     ` Sam Ravnborg [this message]
2008-05-12  7:19                       ` Jiri Slaby
2008-05-11 23:18                 ` Marcel Holtmann
2008-05-11 23:15               ` [PATCH 8/9] HID: move apple quirks Marcel Holtmann
2008-05-11 23:20     ` [PATCH 3/9] HID: hid, make parsing event driven Marcel Holtmann
2008-05-14  9:34       ` Jiri Slaby
2008-05-14 12:08         ` Jiri Kosina
2008-05-11 23:05   ` [PATCH 2/9] HID: make a bus from hid code Marcel Holtmann
2008-05-14  9:30     ` Jiri Slaby
2008-05-15  9:11       ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080511211839.GA1641@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@linux-foundation.org \
    --cc=anssi.hannula@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jirislaby@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).