From nobody Sun Feb 8 02:26:15 2026 Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9032A337B81 for ; Sat, 7 Feb 2026 16:53:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770483190; cv=none; b=n3ATWNif1oTZkuq4wHBSP98JcfGPSXmmYQphGS7AnZ/AOPhguKOg6Tak8MqFIXYNlXoDGPgKOdd6I2287Dg04o41sNgG29SAtiBqy8Yosnzui3+K0TPPXhXTvb1B6CDKi/KNUCuaWUtPk9a2VQ6MT2FM2J6YoSrGXXB749Ei2iU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770483190; c=relaxed/simple; bh=1PFEnQSQHK+HxFV+EnhDucivwjFM9S83+Z/X8r6YxYQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yn4ivdmJs6AMt68zeg0cv4bCGDIcnS7OiwZVwiG1yHlIQYIVexabctZNcGKFEc7tXrTJ4IvL+naGqCKxxnldJDCqPdfv0VYlzYrM8q/mhHcLAa6GUs2GwhzquzysPUuqJsZkzRL6+bovndTWBReIgpNaZHHZow/23fSFeyUHU8g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NAO94GJ+; arc=none smtp.client-ip=74.125.82.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NAO94GJ+" Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-2b785801c93so4353338eec.0 for ; Sat, 07 Feb 2026 08:53:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770483190; x=1771087990; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9bn5hyN+m1LqNXQxKRBXBAhoYRIb38PYsM30rn8LzHo=; b=NAO94GJ+upNZ1xjZlVEaTmcENOuVfl6cQgqcd+gWHkWBG/ydmYzNkZSE3/vJ+gXpbc POa7BjOQE000A/6lhy9QVLbqBXoPiPuJchhE4iigqksloLvUqjYCwZGqaQW/myWPBRIi yy50ijtjBHly1sn7n5Ot6n7LxGEahdizUeWt8lnTXlTshzt1wqOaGoT/bLR4Sgbxnxf2 9S0pPOvIo4APKQUCrppHywmYjbjoDBOXzkZFJYlTvH+IngnBYdRT4W0R/8+AGYZB/dNz +poNtOkDnAKs6vpj62sjYK0nLzn77bmijFRGjttRAwFes++CisW1qptO+DRuuGhfri1f 9WoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770483190; x=1771087990; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9bn5hyN+m1LqNXQxKRBXBAhoYRIb38PYsM30rn8LzHo=; b=fzJJPTxK6mDiF3iB3pdCqjHDeY4IroE14ZWWjgymaUS9wqoHJBSxxgMPTm1VtDepcw DW5aHuPwIK1niPuMLL2JVJU5iTzbizOhPPp11y/937R08r4YpRycFRJw7pCvHQBEpl57 IETKVUtTUlgEHNoj86qegpqjObxdid5AP4QIvmnd/X/4tHcJTg7M1i8GnCobkEihWH/I WrDMoKfRzkalt3mOxaE6m67RophQBTuajCwoR63P0/w3menPWz7/PvGyZ94Pp0Hz5BJT Ra88L5ORJR06+sLDCxi7TeffNyAJ2SNVHruNX/m6NjrMXYuvJCMa4xENPqIi1mFhPbgi y/6w== X-Forwarded-Encrypted: i=1; AJvYcCWTMhvmPSMnjJX6FGvL61PEFiicc/ZRwpRCHFLK9rM69qVo88vUOB2zZI1ROCDftTEhEze5vIb7c/XaRLg=@vger.kernel.org X-Gm-Message-State: AOJu0Yww2I3IdTzsRjJJ6ry6Ion7ooTmqBcBX+jL/H6LINITOD6n/FpX P2UGSPw5SkvAd7OEH6ediVc0XWxhIjx3pZFJIXMnfj0woffrccmV7qVx X-Gm-Gg: AZuq6aIhMkuVBd5GaAIZp36DfvIJQwz75HSBI+VsNd/CSAQl2f0bqm9zDctIJvRFx/7 F8MOOpph7/0JuJjimchj0RZqyHs0du55+kDGEiiQqEtEznTqtgOt4MepEH6R9uEGSwRu+/us7/k a0jsnL51s3fNMCWMrxEUinhnz+ZFmQmMLOlq0WZHgGV3la47Fb+z979P9TRynCYVveLSBzkiiTA ZXXIMOwdNSKY0h1oV9430z3a2ClU2HQDqqUEw6M9ZbV0b6R/04ZNhqjRwYuSdR3mx+bevS2uTkG +dtLbXtlbLVxe2XdYwKJoI01NwMdQUbau+p3NX0OWjMWxW3dDX+HG0p0CGQCVFAfF5MLZpsrLuP Wv1/5OQKs9WGpoK+adm8XUrW+2CkCJF2qwnG0o+8TMTX10M/CLfTZEbK2Psvuj7G7E9JqSkdN3w o4CcMkmATkQrjKiwfAxIp3pYgCJ5n9aCjkXZqBGGVSK7qSgHGPaU5aLfCcgqJAY9/4 X-Received: by 2002:a05:693c:60c3:b0:2b8:6b32:1cf1 with SMTP id 5a478bee46e88-2b86b3224fdmr781427eec.29.1770483189514; Sat, 07 Feb 2026 08:53:09 -0800 (PST) Received: from jason-hall-A520-B.. ([2600:8800:41a0:8000:22c3:7b0e:5e40:3e51]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b855ad8da2sm4438907eec.5.2026.02.07.08.53.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Feb 2026 08:53:08 -0800 (PST) From: Jason Hall To: Miguel Ojeda Cc: Joe Perches , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Hall , Miguel Ojeda Subject: [PATCH v7] scripts: checkpatch: move Rust-specific lints to separate file Date: Sat, 7 Feb 2026 09:53:05 -0700 Message-ID: <20260207165305.129822-1-jason.kei.hall@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Suggested-by: Miguel Ojeda Signed-off-by: Jason Hall --- --- MAINTAINERS | 6 ++++++ scripts/checkpatch.pl | 14 ++++++++++++++ scripts/rust_checkpatch.pl | 16 ++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 scripts/rust_checkpatch.pl diff --git a/MAINTAINERS b/MAINTAINERS index 2c0bdd08b74c..57831dc30e6b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5880,6 +5880,12 @@ R: Lukas Bulwahn S: Maintained F: scripts/checkpatch.pl =20 +CHECKPATCH RUST LINTS +M: Jason Hall +L: rust-for-linux@vger.kernel.org +S: Maintained +F: scripts/rust_checkpatch.pl + CHECKPATCH DOCUMENTATION M: Dwaipayan Ray M: Lukas Bulwahn 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 =3D dirname(abs_path($P)); =20 my $V =3D '0.32'; =20 +my $rust_checkpatch_available =3D 0; +if (-e "$D/rust_checkpatch.pl") { + require "$D/rust_checkpatch.pl"; + $rust_checkpatch_available =3D 1; +} + use Getopt::Long qw(:config no_auto_abbrev); =20 my $quiet =3D 0; @@ -2947,6 +2953,14 @@ sub process { =20 $cnt_lines++ if ($realcnt !=3D 0); =20 +# Check for Rust-specific lints + if ($rust_checkpatch_available && $realfile =3D~ /\.rs$/) { + my ($type, $msg) =3D 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 + +use strict; +use warnings; + +sub process_rust { + my ($line, $rawline, $herecurr) =3D @_; + + # Reserve for future Rust-specific lints + return (); +} + +1; --=20 2.43.0