linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Trond@black.fi.intel.com,
	Myklebust@black.fi.intel.com, trond.myklebust@hammerspace.com,
	Anna Schumaker <anna.schumaker@netapp.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Josh Triplett <josh@joshtriplett.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2 1/2] kernel.h: Split out min()/max() et al helpers
Date: Tue, 04 Feb 2020 17:17:36 -0800	[thread overview]
Message-ID: <ee9b52c291fe7f090d6516397db978eaaae6c657.camel@perches.com> (raw)
In-Reply-To: <c02c86a1-5df3-1b94-78a7-3948bd9e64cb@rasmusvillemoes.dk>

On Wed, 2020-02-05 at 00:23 +0100, Rasmus Villemoes wrote:
> On 04/02/2020 18.04, Andy Shevchenko wrote:
> > kernel.h is being used as a dump for all kinds of stuff for a long time.
> > Here is the attempt to start cleaning it up by splitting out min()/max()
> > et al helpers.
> > 
> > At the same time convert users in header and lib folder to use new header.
> > Though for time being include new header back to kernel.h to avoid twisted
> > indirected includes for existing users.
> 
> This is definitely long overdue, so thanks for taking this on. I think
> minmax.h is fine as a header on its own, but for the other one, I think
> you should go even further - and perhaps all these should go in a
> include/math/ dir (include/linux/ has ~1200 files), so we'd have
> math/minmax.h, math/round.h, math/ilog2.h, math/gcd.h etc., each
> containing just enough #includes to be self-contained (so if there's a
> declaration of something taking a u32, there's no way around having it
> include types.h (or wherever that's defined).

I think that's not at all desirable.

kernel.h as a monolithic include block is pretty useful.

Separating out the various bits into separate files is
OK, but kernel.h should #include them all.

One day a precompiled header of just kernel.h would be
useful to reduce overall compilation time.  Converting
all the other source files that use a small part of the
existing kernel.h into multiple includes would not allow
precompiled headers to work efficiently.




  reply	other threads:[~2020-02-05  1:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 17:04 [PATCH v2 1/2] kernel.h: Split out min()/max() et al helpers Andy Shevchenko
2020-02-04 17:04 ` [PATCH v2 2/2] kernel.h: Split out mathematical helpers Andy Shevchenko
2020-02-05  1:57   ` kbuild test robot
2020-02-04 23:23 ` [PATCH v2 1/2] kernel.h: Split out min()/max() et al helpers Rasmus Villemoes
2020-02-05  1:17   ` Joe Perches [this message]
2020-02-05 11:17     ` Andy Shevchenko
2020-02-06 11:32   ` Andy Shevchenko

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=ee9b52c291fe7f090d6516397db978eaaae6c657.camel@perches.com \
    --to=joe@perches.com \
    --cc=Myklebust@black.fi.intel.com \
    --cc=Trond@black.fi.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anna.schumaker@netapp.com \
    --cc=arnd@arndb.de \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=paulmck@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=trond.myklebust@hammerspace.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;
as well as URLs for NNTP newsgroup(s).