[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260207210805.196759-2-jason.kei.hall@gmail.com>
Date: Sat, 7 Feb 2026 14:07:45 -0700
From: Jason Hall <jason.kei.hall@...il.com>
To: Miguel Ojeda <ojeda@...nel.org>,
Joe Perches <joe@...ches.com>
Cc: rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org,
Boqun Feng <boqun.feng@...il.com>,
Björn Roy Baron <bjorn.roy.baron@...il.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakru@...nel.org>,
Dirk Behme <dirk.behme@...bosch.com>,
Andy Whitcroft <apw@...onical.com>,
Dwaipayan Ray <dwaipayanray1@...il.com>,
Lukas Bulwahn <lukas.bulwahn@...il.com>,
Jason Hall <jason.kei.hall@...il.com>
Subject: [PATCH v8 1/2] scripts: checkpatch: move Rust-specific lints to separate file
Create scripts/rust_checkpatch.pl for Rust-specific linting logic.
Add a conditional loading hook in scripts/checkpatch.pl to call it.
This will allow Rust linting logic to be maintained independently.
Add a new entry to the MAINTAINERS file to track this new file.
Suggested-by: Joe Perches <joe@...ches.com>
Suggested-by: Miguel Ojeda <ojeda@...nel.org>
Signed-off-by: Jason Hall <jason.kei.hall@...il.com>
---
MAINTAINERS | 22 ++++++++++++++--------
scripts/checkpatch.pl | 14 ++++++++++++++
scripts/rust_checkpatch.pl | 16 ++++++++++++++++
3 files changed, 44 insertions(+), 8 deletions(-)
create mode 100644 scripts/rust_checkpatch.pl
diff --git a/MAINTAINERS b/MAINTAINERS
index f6bc65de83c7..57831dc30e6b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4109,7 +4109,7 @@ F: drivers/input/touchscreen/atmel_mxt_ts.c
ATOMIC INFRASTRUCTURE
M: Will Deacon <will@...nel.org>
M: Peter Zijlstra <peterz@...radead.org>
-M: Boqun Feng <boqun.feng@...il.com>
+M: Boqun Feng <boqun@...nel.org>
R: Mark Rutland <mark.rutland@....com>
R: Gary Guo <gary@...yguo.net>
L: linux-kernel@...r.kernel.org
@@ -4500,7 +4500,7 @@ F: lib/sbitmap.c
BLOCK LAYER DEVICE DRIVER API [RUST]
M: Andreas Hindborg <a.hindborg@...nel.org>
-R: Boqun Feng <boqun.feng@...il.com>
+R: Boqun Feng <boqun@...nel.org>
L: linux-block@...r.kernel.org
L: rust-for-linux@...r.kernel.org
S: Supported
@@ -5880,6 +5880,12 @@ R: Lukas Bulwahn <lukas.bulwahn@...il.com>
S: Maintained
F: scripts/checkpatch.pl
+CHECKPATCH RUST LINTS
+M: Jason Hall <jason.kei.hall@...il.com>
+L: rust-for-linux@...r.kernel.org
+S: Maintained
+F: scripts/rust_checkpatch.pl
+
CHECKPATCH DOCUMENTATION
M: Dwaipayan Ray <dwaipayanray1@...il.com>
M: Lukas Bulwahn <lukas.bulwahn@...il.com>
@@ -11264,7 +11270,7 @@ F: tools/testing/selftests/timers/
DELAY, SLEEP, TIMEKEEPING, TIMERS [RUST]
M: Andreas Hindborg <a.hindborg@...nel.org>
-R: Boqun Feng <boqun.feng@...il.com>
+R: Boqun Feng <boqun@...nel.org>
R: FUJITA Tomonori <fujita.tomonori@...il.com>
R: Frederic Weisbecker <frederic@...nel.org>
R: Lyude Paul <lyude@...hat.com>
@@ -14559,7 +14565,7 @@ M: Alan Stern <stern@...land.harvard.edu>
M: Andrea Parri <parri.andrea@...il.com>
M: Will Deacon <will@...nel.org>
M: Peter Zijlstra <peterz@...radead.org>
-M: Boqun Feng <boqun.feng@...il.com>
+M: Boqun Feng <boqun@...nel.org>
M: Nicholas Piggin <npiggin@...il.com>
M: David Howells <dhowells@...hat.com>
M: Jade Alglave <j.alglave@....ac.uk>
@@ -14718,7 +14724,7 @@ LOCKING PRIMITIVES
M: Peter Zijlstra <peterz@...radead.org>
M: Ingo Molnar <mingo@...hat.com>
M: Will Deacon <will@...nel.org>
-M: Boqun Feng <boqun.feng@...il.com> (LOCKDEP & RUST)
+M: Boqun Feng <boqun@...nel.org> (LOCKDEP & RUST)
R: Waiman Long <longman@...hat.com>
L: linux-kernel@...r.kernel.org
S: Maintained
@@ -21912,7 +21918,7 @@ M: Frederic Weisbecker <frederic@...nel.org> (kernel/rcu/tree_nocb.h)
M: Neeraj Upadhyay <neeraj.upadhyay@...nel.org> (kernel/rcu/tasks.h)
M: Joel Fernandes <joelagnelf@...dia.com>
M: Josh Triplett <josh@...htriplett.org>
-M: Boqun Feng <boqun.feng@...il.com>
+M: Boqun Feng <boqun@...nel.org>
M: Uladzislau Rezki <urezki@...il.com>
R: Steven Rostedt <rostedt@...dmis.org>
R: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
@@ -22362,7 +22368,7 @@ RESTARTABLE SEQUENCES SUPPORT
M: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
M: Peter Zijlstra <peterz@...radead.org>
M: "Paul E. McKenney" <paulmck@...nel.org>
-M: Boqun Feng <boqun.feng@...il.com>
+M: Boqun Feng <boqun@...nel.org>
L: linux-kernel@...r.kernel.org
S: Supported
F: include/trace/events/rseq.h
@@ -22885,7 +22891,7 @@ F: tools/verification/
RUST
M: Miguel Ojeda <ojeda@...nel.org>
-R: Boqun Feng <boqun.feng@...il.com>
+R: Boqun Feng <boqun@...nel.org>
R: Gary Guo <gary@...yguo.net>
R: Björn Roy Baron <bjorn3_gh@...tonmail.com>
R: Benno Lossin <lossin@...nel.org>
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c0250244cf7a..f75cb70ad0dd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -20,6 +20,12 @@ my $D = dirname(abs_path($P));
my $V = '0.32';
+my $rust_checkpatch_available = 0;
+if (-e "$D/rust_checkpatch.pl") {
+ require "$D/rust_checkpatch.pl";
+ $rust_checkpatch_available = 1;
+}
+
use Getopt::Long qw(:config no_auto_abbrev);
my $quiet = 0;
@@ -2947,6 +2953,14 @@ sub process {
$cnt_lines++ if ($realcnt != 0);
+# Check for Rust-specific lints
+ if ($rust_checkpatch_available && $realfile =~ /\.rs$/) {
+ my ($type, $msg) = process_rust($line, $rawline, $herecurr);
+ if ($type) {
+ WARN($type, $msg);
+ }
+ }
+
# Verify the existence of a commit log if appropriate
# 2 is used because a $signature is counted in $commit_log_lines
if ($in_commit_log) {
diff --git a/scripts/rust_checkpatch.pl b/scripts/rust_checkpatch.pl
new file mode 100644
index 000000000000..56c1bc29d3f2
--- /dev/null
+++ b/scripts/rust_checkpatch.pl
@@ -0,0 +1,16 @@
+#!/usr/bin/env perl
+# SPDX-License-Identifier: GPL-2.0
+#
+# (c) 2026, Jason Hall <jason.kei.hall@...il.com>
+
+use strict;
+use warnings;
+
+sub process_rust {
+ my ($line, $rawline, $herecurr) = @_;
+
+ # Reserve for future Rust-specific lints
+ return ();
+}
+
+1;
--
2.43.0
Powered by blists - more mailing lists