linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Kosina <jkosina@suse.cz>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alan Ott <alan@signal11.us>
Subject: Re: linux-next: build failure after merge of the hid tree
Date: Fri, 8 Apr 2011 16:54:51 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LNX.2.00.1104081645480.6022@pobox.suse.cz> (raw)
In-Reply-To: <20110407110626.397202fb.sfr@canb.auug.org.au>

On Thu, 7 Apr 2011, Stephen Rothwell wrote:

> Hi Jiri,
> 
> After merging the hid tree, today's linux-next build (x86_64 allmodconfig)
> failed like this:
> 
> samples/hidraw/hid-example.c: In function 'main':
> samples/hidraw/hid-example.c:103: warning: implicit declaration of function 'HIDIOCSFEATURE'
> samples/hidraw/hid-example.c:111: warning: implicit declaration of function 'HIDIOCGFEATURE'
> tmp/ccK96SHd.o: In function `main':
> hid-example.c:(.text+0x205): undefined reference to `HIDIOCSFEATURE'
> hid-example.c:(.text+0x23e): undefined reference to `HIDIOCGFEATURE'
> 
> Caused by commit c54ea4918c2b ("HID: Documentation for hidraw").  I can
> only assume that linux/hidraw.h is being included from /usr/include and
> not the kernel tree being built?
> 
> I have used the hid tree from next-20110406 for today.

OK, I have introduced the patch below to the branch now. I am not proud of 
it, but I don't see other option currently. Will remove it after some 
time.



From: Jiri Kosina <jkosina@suse.cz>
Subject: [PATCH] HID: hidraw: fix samples miscompilation

On systems where userspace doesn't have new hidraw.h populated to
/usr/include, the hidraw sample won't compile as it's missing the new
ioctl defitions.

Introduce temporary ugly workaround to define the ioctls "manually"
in such cases, just to avoid miscompilation in allmodconfig cases.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 samples/hidraw/hid-example.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/samples/hidraw/hid-example.c b/samples/hidraw/hid-example.c
index 40e3d62..816e2dc 100644
--- a/samples/hidraw/hid-example.c
+++ b/samples/hidraw/hid-example.c
@@ -14,6 +14,17 @@
 #include <linux/input.h>
 #include <linux/hidraw.h>
 
+/*
+ * Ugly hack to work around failing compilation on systems that don't
+ * yet populate new version of hidraw.h to userspace.
+ *
+ * If you need this, please have your distro update the kernel headers.
+ */
+#ifndef HIDIOCSFEATURE
+#define HIDIOCSFEATURE(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
+#define HIDIOCGFEATURE(len)    _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
+#endif
+
 /* Unix */
 #include <sys/ioctl.h>
 #include <sys/types.h>
-- 
1.7.3.1



  parent reply	other threads:[~2011-04-08 23:54 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07  1:06 linux-next: build failure after merge of the hid tree Stephen Rothwell
2011-04-07 13:00 ` Alan Ott
2011-04-08 23:54 ` Jiri Kosina [this message]
2011-06-08  3:03 Stephen Rothwell
2011-06-08  7:26 ` Stefan Kriwanek
2011-06-08  7:50   ` Jiri Kosina
2011-11-29  1:00 Stephen Rothwell
2011-11-29  1:30 ` Jeremy Fitzhardinge
2011-12-19  1:34 Stephen Rothwell
2011-12-19  8:21 ` Jiri Kosina
2012-06-29  2:47 Stephen Rothwell
2012-06-29 13:03 ` Jiri Kosina
2016-12-11 23:59 Stephen Rothwell
2016-12-12  8:50 ` Jiri Kosina
2019-10-04  0:28 Stephen Rothwell
2019-10-04  6:55 ` Hans de Goede
2021-05-27  5:26 Stephen Rothwell
2021-05-27  8:14 ` Jiri Kosina
2021-05-27  8:25   ` Hans de Goede
2021-05-27 13:22     ` Naresh Kamboju
2021-05-27 13:42     ` Jiri Kosina
2021-12-03  7:01 Stephen Rothwell
2021-12-03  8:09 ` Greg Kroah-Hartman
2022-07-25  0:40 Stephen Rothwell
2022-07-25  9:42 ` Jiri Kosina
2022-07-27  1:11   ` Stephen Rothwell
2024-02-28  3:56 Stephen Rothwell
2024-04-11  0:51 Stephen Rothwell
2024-04-11  7:17 ` Benjamin Tissoires
2024-05-07  1:06 Stephen Rothwell
2024-05-07  7:22 ` Kenny Levinsen

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=alpine.LNX.2.00.1104081645480.6022@pobox.suse.cz \
    --to=jkosina@suse.cz \
    --cc=alan@signal11.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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).