All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] another project or two
Date: Mon, 04 Jun 2007 12:00:17 +0000	[thread overview]
Message-ID: <20070604120017.GZ23968@parisc-linux.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0706040528251.31127@localhost.localdomain>

On Mon, Jun 04, 2007 at 05:31:23AM -0400, Robert P. J. Day wrote:
>   also, something i've been thinking about for a while is the
> feasibility of centralizing a lot of the identical information that is
> duplicated across all of the include/asm-* header files.  as an
> example, if you take a look at all of the include/asm-*/types.h files,
> there's a lot of absolutely identical content.
> 
>   i'm wondering if there's any value to factoring all the common
> content and just leaving the differences in the arch-specific files.
> thoughts?

My thought is "Bad idea".  An example of this is asm/errno.h.  Before,
when I wanted to know what -27 was, I would go and look in asm/errno.h.
Now, I have to look in asm/errno.h which may direct me to
asm-generic/errno.h, which redirects me to asm-generic/errno-base.h,
which tells me it's EFBIG.  Worse, not all arches use
asm-generic/errno.h, so I may look in the wrong file by mistake.

The other response in this thread suggested that centralising things
would reduce compile time.  This obviously can't be true; we're
opening, reading and closing two additional files.

What *is* a win is providing a mechanism for adding a new
errno/type/whatever to every architecture, without editing 27 header
files.  The normal way to do something like this is:

<linux/foo.h>
includes <asm/foo.h>

#ifndef THINGY
#define THINGY *suitale definition*
#endif

which allows architectures to override it when they need to.

I know it looks wasteful, redundant and possibly even error-prone to
define the same things over and over in asm/types.h, but it really is
better than the alternative.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2007-06-04 12:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-04  9:31 [KJ] another project or two Robert P. J. Day
2007-06-04 11:22 ` John Anthony Kazos Jr.
2007-06-04 12:00 ` Matthew Wilcox [this message]
2007-06-04 13:27 ` Robert P. J. Day
2007-06-04 13:48 ` Matthew Wilcox

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=20070604120017.GZ23968@parisc-linux.org \
    --to=matthew@wil.cx \
    --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.