Linux driver-core infrastructure
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	 Danilo Krummrich <dakr@kernel.org>,
	Johan Hovold <johan@kernel.org>,
	Luis Chamberlain <mcgrof@kernel.org>
Cc: Dave Ertman <david.m.ertman@intel.com>,
	Ira Weiny <iweiny@kernel.org>,  Leon Romanovsky <leon@kernel.org>,
	Kees Cook <kees@kernel.org>, Miguel Ojeda <ojeda@kernel.org>,
	 Nathan Chancellor <nathan@kernel.org>,
	driver-core@lists.linux.dev, llvm@lists.linux.dev,
	 linux-kernel@vger.kernel.org, Ian Rogers <irogers@google.com>
Subject: [PATCH 0/3] driver core: Add __must_init annotations to core registration structs
Date: Mon, 30 Nov 2026 14:53:37 -0800	[thread overview]
Message-ID: <20261130225340.96859-1-irogers@google.com> (raw)

Following the addition of __must_init in driver-core-next, this series
annotates mandatory fields in core device-model and firmware upload
structures whose registration functions reject missing values at
runtime:

  1. struct bus_type::name and struct class::name (checked via
     kobject_set_name() in bus_register() and class_register())
  2. struct auxiliary_driver::probe and id_table (checked with WARN_ON()
     in __auxiliary_driver_register())
  3. struct fw_upload_ops::prepare, write, poll_complete, and cancel
     (checked in firmware_upload_register())

All existing in-tree initializers already populate these fields; tested
with an x86_64 LLVM=1 build on top of driver-core-next with zero
warnings.

Tooling note: Clang's require_explicit_initialization attribute
(__must_init) was used to verify all in-tree initializers, and an AI
coding assistant helped audit the registration paths and draft the
commit messages. All changes were reviewed and build-tested locally.

Ian Rogers (3):
  driver core: Require explicit initialization of class and bus_type
    name
  driver core: auxiliary: Annotate probe and id_table with __must_init
  firmware_loader: Annotate mandatory fw_upload_ops with __must_init

 include/linux/auxiliary_bus.h | 5 +++--
 include/linux/device/bus.h    | 2 +-
 include/linux/device/class.h  | 2 +-
 include/linux/firmware.h      | 9 +++++----
 4 files changed, 10 insertions(+), 8 deletions(-)


base-commit: f62fba71a846ebe59423bfd057af023b418935a0
-- 
2.56.1.839.g22a8290db9-goog


             reply	other threads:[~2026-11-30 22:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 22:53 Ian Rogers [this message]
2026-11-30 22:53 ` [PATCH 1/3] driver core: Require explicit initialization of class and bus_type name Ian Rogers
2026-11-30 22:53 ` [PATCH 2/3] driver core: auxiliary: Annotate probe and id_table with __must_init Ian Rogers
2026-11-30 22:53 ` [PATCH 3/3] firmware_loader: Annotate mandatory fw_upload_ops " Ian Rogers

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=20261130225340.96859-1-irogers@google.com \
    --to=irogers@google.com \
    --cc=dakr@kernel.org \
    --cc=david.m.ertman@intel.com \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=iweiny@kernel.org \
    --cc=johan@kernel.org \
    --cc=kees@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mcgrof@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rafael@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox