Skip to content

kernel.h further split

Andy Shevchenko linux-kselftest linux-media lkml llvm oe-kbuild-all 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest7 patches 0 repliesNew 6 of 7 applied
  2. v47 patches 17 repliesSuperseded
  3. v37 patches 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v24 patches12 repliesSuperseded
v11 patch4 repliesSuperseded

Patches in v5 6 of 7 applied

#Subject and filesSizeRepliesApplied
1/7kernel.h: Drop unneeded <linux/kernel.h> inclusion from other headersinclude/linux/rwsem.h include/linux/smp.h include/linux/spinlock.h+0 -30 replies
2/7kernel.h: Split out container_of() and typeof_member() macrosinclude/linux/container_of.h include/linux/kernel.h+41 -320 repliesApplied
3/7kunit: Replace kernel.h with the necessary inclusionsinclude/kunit/test.h+11 -20 repliesApplied
4/7list: Replace kernel.h with the necessary inclusionsinclude/linux/list.h+3 -10 repliesApplied
5/7llist: Replace kernel.h with the necessary inclusionsinclude/linux/llist.h+3 -10 repliesApplied
6/7plist: Replace kernel.h with the necessary inclusionsinclude/linux/plist.h+4 -10 repliesApplied
7/7media: entity: Replace kernel.h with the necessary inclusionsinclude/media/media-entity.h+2 -10 repliesApplied

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchSakari Ailus
1/7
2/7
3/7
4/7
5/7
6/7
7/7A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/7] kernel.h further split

v4: https://lore.kernel.org/linux-media/[email protected]/T/#u
v3: https://lore.kernel.org/linux-media/[email protected]/T/#u
v2: https://lore.kernel.org/linux-media/[email protected]/T/#u

The kernel.h is a set of something which is not related to each other and often used in non-crossed compilation units, especially when drivers need only one or two macro definitions from it.

Here is the split of container_of(). The goals are the following:
- untwist the dependency hell a bit
- drop kernel.h inclusion where it's only used for container_of()

In v5:
- dropped code duplication (Miguel)
- added necessary includes into container_of.h (Joe)
- dropped other header shuffling in list.h (Jonathan)
- added tag (Sakari)

In v4:
- dropped kobject.h change (Greg)
- Cc'ed more people (as per v1)

In v3:
- split patch 2 to more patches (Greg)
- excluded C changes (Herbert, Greg)
- measured with kcbench, see below (Greg)

Andy Shevchenko (7):
kernel.h: Drop unneeded <linux/kernel.h> inclusion from other headers kernel.h: Split out container_of() and typeof_member() macros
kunit: Replace kernel.h with the necessary inclusions
list: Replace kernel.h with the necessary inclusions
llist: Replace kernel.h with the necessary inclusions
plist: Replace kernel.h with the necessary inclusions
media: entity: Replace kernel.h with the necessary inclusions

 include/kunit/test.h         | 13 ++++++++++--
 include/linux/container_of.h | 40 ++++++++++++++++++++++++++++++++++++
 include/linux/kernel.h       | 33 +----------------------------
 include/linux/list.h         |  4 +++-
 include/linux/llist.h        |  4 +++-
 include/linux/plist.h        |  5 ++++-
 include/linux/rwsem.h        |  1 -
 include/linux/smp.h          |  1 -
 include/linux/spinlock.h     |  1 -
 include/media/media-entity.h |  3 ++-
 10 files changed, 64 insertions(+), 41 deletions(-)
 create mode 100644 include/linux/container_of.h
Signature · 1 line
2.33.0