All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Knutsson <ricknu-0@student.ltu.se>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] the standard for including header files?
Date: Mon, 28 May 2007 22:35:27 +0000	[thread overview]
Message-ID: <465B592F.7060105@student.ltu.se> (raw)
In-Reply-To: <Pine.LNX.4.64.0705281627190.15720@localhost.localdomain>

Robert P. J. Day wrote:
>   in my travels thru the source tree, i've noticed header files like
> the following (include/linux/ioctl.h):
>
> #ifndef _LINUX_IOCTL_H
> #define _LINUX_IOCTL_H
>
> #include <asm/ioctl.h>
>
> #endif /* _LINUX_IOCTL_H */
>
>   fair enough -- it simply includes the asm-specific form of that
> header file, so one can include either of those two header files to
> get exactly the same effect.
>
>   but what's the *correct* header file to include?  *at the moment*,
> those two includes are equivalent but nothing says they have to be
> that way forever.  perhaps some day some arch-independent content is
> added to linux/ioctl.h.  if that happens, those files that include
> *that* header file will pick up the additional content, while files
> that instead include asm/ioctl.h won't.
>
>   it may be that this will never be a problem, but there certainly is
> some variety of who is including what in the source tree:
>
> $ grep -r "include.*linux/ioctl.h" * | wc -l
> 131
> $ grep -r "include.*asm/ioctl.h" * | wc -l
> 40
>
>   there are a few other header files like that:  user.h, param.h, etc.
> i'm just wondering what the standard is.
>   
We want our drivers to be independent of the architectures and if there 
is a header in include/linux/, then what is the reason to include the 
include/asm/? Like types.h, where the generic header includes the 
arch-specific header to get [su]{8,16,32,64}-types. The only reason I 
can see when you want to include from include/asm/ is when a driver will 
only work on a subset of the architectures.

But as a wise man said; that is just my opinion, I could be wrong.
Richard Knutson

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

      parent reply	other threads:[~2007-05-28 22:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-28 20:35 [KJ] the standard for including header files? Robert P. J. Day
2007-05-28 22:09 ` Randy Dunlap
2007-05-28 22:35 ` Richard Knutsson [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=465B592F.7060105@student.ltu.se \
    --to=ricknu-0@student.ltu.se \
    --cc=kernel-janitors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.