All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Andy Shevchenko' <andy.shevchenko@gmail.com>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Brendan Higgins <brendanhiggins@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"Alexey Dobriyan" <adobriyan@gmail.com>,
	Miguel Ojeda <ojeda@kernel.org>,
	"Mauro Carvalho Chehab" <mchehab+huawei@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	KUnit Development <kunit-dev@googlegroups.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Waiman Long <longman@redhat.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	"Alexei Starovoitov" <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>, Thomas Graf <tgraf@suug.ch>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: RE: [PATCH v1 3/3] kernel.h: Split out container_of() and typeof_memeber() macros
Date: Tue, 13 Jul 2021 13:58:25 +0000	[thread overview]
Message-ID: <8a81e53ed3fb4f92878cd7f0d2552861@AcuMS.aculab.com> (raw)
In-Reply-To: <CAHp75VfGd6VYyCjbqxO91B4RyyYuNQd_XKJA=yLMWJpa7-Yi9Q@mail.gmail.com>

> The whole idea came when discussing drivers, esp. IIO ones. They often
> are using ARRAY_SIZE() + container_of(). kernel.h is a big overkill
> there.

It probably makes no difference.
Even apparently trivial includes pull in most of the world.

I managed to get a compile error from one of the defines
in sys/ioctl.h - the include sequence the compiler gave
me was about 20 deep.
I've forgotten where it started, but it meandered through
some arch/x86 directories.

I suspect that some files have a #include where just a
'struct foo' would suffice.

There will also be .h files which include both the 'public'
interface and 'private' definitions.
Sometimes splitting those can reduce the number of includes.
This is most noticeable compiling trivial drivers.

The other way to speed up compilations is to reduce the -I
path list to the compiler.
This is particularly significant if compiling over NFS.
(Well NFS might have changed, but...)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  reply	other threads:[~2021-07-13 13:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  8:45 [PATCH v1 1/3] kernel.h: Don't pollute header with single user macros Andy Shevchenko
2021-07-13  8:45 ` [PATCH v1 2/3] kernel.h: Drop unneeded <linux/kernel.h> inclusion from other headers Andy Shevchenko
2021-07-13  8:45 ` [PATCH v1 3/3] kernel.h: Split out container_of() and typeof_memeber() macros Andy Shevchenko
2021-07-13 10:37   ` Greg Kroah-Hartman
2021-07-13 11:16     ` Andy Shevchenko
2021-07-13 11:23       ` Greg Kroah-Hartman
2021-07-13 12:19         ` Herbert Xu
2021-07-13 12:45           ` Andy Shevchenko
2021-07-13 13:58             ` David Laight [this message]
2021-07-13 18:39         ` Miguel Ojeda
2021-10-07  9:20           ` Andy Shevchenko
2021-10-07 10:00             ` Andy Shevchenko
2021-10-07 15:39             ` Miguel Ojeda
2021-10-07 15:55               ` Andy Shevchenko
2021-07-13 12:38 ` [PATCH v1 1/3] kernel.h: Don't pollute header with single user macros Peter Zijlstra
2021-07-13 12:42   ` 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=8a81e53ed3fb4f92878cd7f0d2552861@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrii@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=ast@kernel.org \
    --cc=boqun.feng@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=brendanhiggins@google.com \
    --cc=daniel@iogearbox.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=jic23@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=longman@redhat.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=songliubraving@fb.com \
    --cc=tgraf@suug.ch \
    --cc=will@kernel.org \
    --cc=yhs@fb.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 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.