public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Zijun Hu <zijun.hu@oss.qualcomm.com>,
	linux-kernel@vger.kernel.org, driver-core@lists.linux.dev,
	linux-acpi@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Danilo Krummrich <dakr@kernel.org>, Len Brown <lenb@kernel.org>,
	Daniel Scally <djrscally@gmail.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>
Subject: Re: [PATCH v1 1/3] driver core: Split device data types to device/types.h
Date: Tue, 24 Feb 2026 16:01:38 +0200	[thread overview]
Message-ID: <aZ2vQm3cQtBrmqMO@smile.fi.intel.com> (raw)
In-Reply-To: <CAJZ5v0hUwCFKH3f6pCW1idquyJ-93wtXzO70tq6D+ruU17+oGw@mail.gmail.com>

On Tue, Feb 24, 2026 at 01:21:10PM +0100, Rafael J. Wysocki wrote:
> On Tue, Feb 24, 2026 at 10:05 AM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Mon, Feb 23, 2026 at 09:53:17PM +0100, Rafael J. Wysocki wrote:
> > > On Mon, Feb 23, 2026 at 9:44 PM Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > >
> > > > device.h is a huge header which is hard to follow and easy to miss
> > > > something. Improve that by splitting device data types to device/types.h.
> > > >
> > > > In particular this helps to speedup the build of the code that includes
> > > > device.h solely for a device data types.
> > > >
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > >
> > > But why do you want to move the struct device definition out of device.h?
> >
> > Because it's a data type, and we have many drivers that may require it
> > (embed the struct device), but no device.h API is called directly —
> > only via a certain framework).
> >
> > device.h also includes many unrelated headers in such a case.
> 
> Why is this a problem?
> 
> Could those headers be moved to different header files instead?
> 
> device.h is mostly about the struct device definition and the other
> stuff in it is more or less additional.  Why do you want to make it
> the other way around?

It's a common trend in the kernel to split out _types.h and _api.h
(among possibly others). I follow this trend with a correction on
the folder versus prefix. That's why device/types.h.

$ git diff $A..$B --diff-filter=A --name-only -- include/ | grep _types.h

In v6.19:
include/linux/fs/super_types.h
include/linux/irq_work_types.h
include/linux/ns/ns_common_types.h
include/linux/ns/nstree_types.h
include/linux/rseq_types.h

In v6.17:
include/linux/unwind_deferred_types.h
include/linux/unwind_user_types.h

In v6.15
include/linux/resctrl_types.h

In v6.11
include/linux/cpumask_types.h

In v6.8
include/linux/hrtimer_types.h
include/linux/irqflags_types.h
include/linux/mutex_types.h
include/linux/nodemask_types.h
include/linux/pid_types.h
include/linux/plist_types.h
include/linux/posix-timers_types.h
include/linux/refcount_types.h
include/linux/seccomp_types.h
include/linux/sem_types.h
include/linux/seqlock_types.h
include/linux/syscall_user_dispatch_types.h
include/linux/timer_types.h
include/linux/timerqueue_types.h
include/linux/uidgid_types.h
include/linux/workqueue_types.h

In v6.4
include/linux/objtool_types.h

In v6.1
include/linux/cfi_types.h
include/linux/kmsan_types.h

In v6.0
include/linux/gfp_types.h
include/linux/io_uring_types.h

-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2026-02-24 14:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 20:30 [PATCH v1 0/3] driver core: Split device.h even more Andy Shevchenko
2026-02-23 20:30 ` [PATCH v1 1/3] driver core: Split device data types to device/types.h Andy Shevchenko
2026-02-23 20:53   ` Rafael J. Wysocki
2026-02-24  9:05     ` Andy Shevchenko
2026-02-24 12:21       ` Rafael J. Wysocki
2026-02-24 13:17         ` Greg Kroah-Hartman
2026-02-24 13:47           ` Danilo Krummrich
2026-02-24 14:02           ` Andy Shevchenko
2026-02-24 14:30             ` Rafael J. Wysocki
2026-02-24 14:01         ` Andy Shevchenko [this message]
2026-02-24 14:34           ` Greg Kroah-Hartman
2026-02-23 20:30 ` [PATCH v1 2/3] driver core: Split device link data types and API to device/devlink.h Andy Shevchenko
2026-02-23 21:00   ` Rafael J. Wysocki
2026-02-23 20:30 ` [PATCH v1 3/3] driver core: Split device related fwnode API to device/fwnode.h Andy Shevchenko
2026-02-23 20:51   ` Rafael J. Wysocki
2026-02-24  0:33   ` Greg Kroah-Hartman
2026-02-24  9:03     ` Andy Shevchenko
2026-02-24  0:32 ` [PATCH v1 0/3] driver core: Split device.h even more Greg Kroah-Hartman

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=aZ2vQm3cQtBrmqMO@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=dakr@kernel.org \
    --cc=djrscally@gmail.com \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=zijun.hu@oss.qualcomm.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