The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@kernel.org>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: break mutual header inclusion
Date: Wed, 28 May 2008 01:27:21 +0300	[thread overview]
Message-ID: <20080527222721.GE11310@cs181133002.pp.htv.fi> (raw)
In-Reply-To: <19f34abd0805271501p5eb4916h5dd37c18be8d21fb@mail.gmail.com>

On Wed, May 28, 2008 at 12:01:02AM +0200, Vegard Nossum wrote:
> Hi!
> 
> On Tue, May 27, 2008 at 11:38 PM, Adrian Bunk <bunk@kernel.org> wrote:
> > On Tue, May 27, 2008 at 10:49:26PM +0200, Vegard Nossum wrote:
> >> Hi,
> >>
> >> What do you think about this? The new file (vm86_mask.h) could actually be
> >> embedded completely in processor-flags.h, but I went for what I believe is
> >> the safer approach.
> >
> > Breaking the mutual header inclusion is appreciated, but some comments
> > are below.
> 
> [...]
> 
> >> -/* the DS BTS struct is used for ptrace as well */
> >> -#include <asm/ds.h>
> >> -
> >>  struct task_struct;
> >>
> >>  extern void ptrace_bts_take_timestamp(struct task_struct *, enum bts_qualifier);
> >
> > Moving #include's out of an #ifdef __KERNEL__ can (and does here) break
> > our userspace headers.
> >
> > Running "make headers_check" after touching anything under include/ is
> > recommended since it catches these problems.
> >
> 
> Ah, that's true. My mistake.
> 
>   CHECK   include/asm/ptrace.h
> [...]/usr/include/asm/ptrace.h requires asm/ds.h, which does not exist
> in exported headers
> 
> What do you reckon is better here, to put #ifdef __KERNEL__ around the
> whole of ds.h and export it, or put #ifdef __KERNEL__ around the
> #include in ptrace.h? It feels wasteful to put it around the whole
> ds.h, since what is the point in exporting an empty file? On the other
> hand, it makes much more sense to put it there than in the "caller" in
> order to avoid the duplication of #ifdef __KERNEL__. So unless you
> prefer otherwise, I will choose the former (to export ds.h as well).

Our userspace headers are an API, and offering empty previsously 
unexported headers to userspace sounds like the worse choice to me.

Additionally, asm/segment.h (and asm/vm86_mask.h) have the same problem.

> I hope you agree with the idea of moving the #include line to the top
> of the file, however?

For me it looks good.

> Thanks for the tip, that is very useful. I didn't realize I should use
> that and I'm sorry for wasting your time with the first attempt :-(

No problem, and I don't consider it a waste of time.

>...
> Thanks for the help :-)
> 
> Vegard

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


      reply	other threads:[~2008-05-27 22:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27 20:49 [PATCH] x86: break mutual header inclusion Vegard Nossum
2008-05-27 21:38 ` Adrian Bunk
2008-05-27 22:01   ` Vegard Nossum
2008-05-27 22:27     ` Adrian Bunk [this message]

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=20080527222721.GE11310@cs181133002.pp.htv.fi \
    --to=bunk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=vegard.nossum@gmail.com \
    /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