public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Cc: dhowells@redhat.com,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	devel@driverdev.osuosl.org, backports@vger.kernel.org,
	rob@ti.com, arnd@arndb.de, davej@redhat.com, airlied@linux.ie,
	bskeggs@redhat.com, alan@lxorguk.ukuu.org.uk, tglx@linutronix.de,
	daniel.vetter@ffwll.ch, jbarnes@virtuousgeek.org,
	alexander.deucher@amd.com, paulmck@linux.vnet.ibm.com,
	gregkh@linuxfoundation.org
Subject: Re: [PATCH 1/2] uapi: update includes for drm content when no kernel API exists
Date: Wed, 17 Oct 2012 00:27:30 +0100	[thread overview]
Message-ID: <7756.1350430050@warthog.procyon.org.uk> (raw)
In-Reply-To: <CAB=NE6VMxhE8O4J+OaKVNUjJqdBEiNkocvueGFn8Wsa8-AG_bQ@mail.gmail.com>

Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:

> >> The include_next trick can work as well but that'd mean synching the UAPI
> >> files regularly into compat. I'd much prefer to have code intact when
> >> possible when backporting so the option I stuck with then was to patch
> >> the code directly and then as part of compat-drivers to always copy
> >> that day's linux-next UAPI headers into the current directory for
> >> compilation. I see no other driver code using the uapi path explicitly
> >> though, is that by design?
> >
> > As far as I understand that's by design, yes. Kernel code isn't expected to
> > reference uapi/ headers directly.
> 
> Did the design consider the case where no respective kernel API header
> file would ever exist?

I didn't particularly design it such that kernel .c files couldn't access uapi
.h files directly.  I did, however, design it so that my scripts wouldn't have
to touch any .c files where possible, and certainly I didn't want to have to
double up all #includes that refer to KAPI/UAPI split headers.

Ideally, I'd've used #include_next in the KAPI file to refer to the UAPI file
where both exist, but some people have strong objections to that, so I ended
up having to do #include <uapi/...> instead.

I also didn't want to rename the asm/, linux/, etc. prefixes as that would
mandate changing pretty much every #include in the kernel.

For the case where no respective KAPI file exists, it was considered and it is
handled.  This is done by adding extra -I flags, for example:

	-I include
	-I include/uapi

so looking for linux/foo.h, say, will look first for include/linux/foo.h and
then for include/uapi/linux/foo.h.

David

  reply	other threads:[~2012-10-16 23:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 23:49 [PATCH 0/2] uapi: two minor changes Luis R. Rodriguez
2012-10-12 23:49 ` [PATCH 1/2] uapi: update includes for drm content when no kernel API exists Luis R. Rodriguez
2012-10-13 10:33   ` Laurent Pinchart
2012-10-13 17:00     ` Luis R. Rodriguez
2012-10-16 12:34       ` Laurent Pinchart
2012-10-16 14:38         ` Luis R. Rodriguez
2012-10-16 23:27           ` David Howells [this message]
2012-10-12 23:49 ` [PATCH 2/2] uapi: remove trailing spaces Luis R. Rodriguez

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=7756.1350430050@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=airlied@linux.ie \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=alexander.deucher@amd.com \
    --cc=arnd@arndb.de \
    --cc=backports@vger.kernel.org \
    --cc=bskeggs@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=davej@redhat.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@do-not-panic.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rob@ti.com \
    --cc=tglx@linutronix.de \
    /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