From nobody Mon Sep 28 23:56:30 2026 Received: from e234-53.smtp-out.ap-northeast-1.amazonses.com (e234-53.smtp-out.ap-northeast-1.amazonses.com [23.251.234.53]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44B1A40E8D7 for ; Fri, 14 Aug 2026 15:51:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=23.251.234.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786722694; cv=none; b=uf2gKhtzguoobGwmCEjKGwDTRB5hOL46xZYGo4zJ/psr3Qtf4Te6bvpUaG3ghQx++HNCwKEuxwl57RIJqFT6gngtEP9dEdKHIAti8OJhdYuIPWJetaE8Y8RK0blr8CqvaRewkDeYLA782CrPwHu1YVrwef48PsadtD5u5QEtVx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786722694; c=relaxed/simple; bh=2UJ4jskcZQ/VrZWunoTDWH54hcdNTqkdcMuSMiy6TFw=; h=From:To:Cc:Subject:Message-ID:Date:MIME-Version:Content-Type; b=eAOwdzMG4UFLkmYHdDY+90Y1pXjXvr8rihWoaWSCv2nLZIljbNhHuoGHk0O7fUQniUseFSnbDccVbZtxvUsDUtSNpZoAamGair3EorYaMOau3qL/SZR7PhHAvnVhwoeP6DNYYWZQeHK59DMhiRKhqXkw7ZcmSoB84wl8/vKPiLU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ariels.xyz; spf=pass smtp.mailfrom=send.ariels.xyz; dkim=pass (1024-bit key) header.d=ariels.xyz header.i=@ariels.xyz header.b=vQ9U7ij/; dkim=pass (1024-bit key) header.d=amazonses.com header.i=@amazonses.com header.b=STFLqzWU; arc=none smtp.client-ip=23.251.234.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ariels.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=send.ariels.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ariels.xyz header.i=@ariels.xyz header.b="vQ9U7ij/"; dkim=pass (1024-bit key) header.d=amazonses.com header.i=@amazonses.com header.b="STFLqzWU" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=resend; d=ariels.xyz; t=1786722691; h=From:To:Cc:Subject:Message-ID:Content-Transfer-Encoding:Date:MIME-Version:Content-Type; bh=2UJ4jskcZQ/VrZWunoTDWH54hcdNTqkdcMuSMiy6TFw=; b=vQ9U7ij/DarocwuEuZmQ5Mtn1HSkdH61h2lsyAHSAhEMNbD3DFDq65qRIYx2J9AW m6WujXz6AuFvtKw7OnByP/KWJne5Lj+mGhZd9a21bCmt2h49mf9dLo61KFOMhnVxfu0 cjBegAlcpgByhadWNJj3BFwccCsQOoCFXEhqmam8= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=zh4gjftm6etwoq6afzugpky45synznly; d=amazonses.com; t=1786722691; h=From:To:Cc:Subject:Message-ID:Content-Transfer-Encoding:Date:MIME-Version:Content-Type:Feedback-ID; bh=2UJ4jskcZQ/VrZWunoTDWH54hcdNTqkdcMuSMiy6TFw=; b=STFLqzWUlHWRCxTY4UUzcnXtLNbNUdL7pwJc2l/ZvC1BnFIhk/mxmp+j7BRJVVpb OyPfATo8klIo4/ARh60174uG+7e/HL0ha5rRtq4/FX4lhvhGhsVG124stJey+gZjO6v MyaDNFV1vnO6IGTbfQzqfra4/AlBg/louA9zd+rQ= X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yXMywqAIBCF4VeJWSdodKNXiRamU01BhmMRRO+e1 fKD/5wLGD0hQ5Nc4PEgJrdGqDQBM+l1REE2GjKZlbJWuViCs04wCaOt6m1eGC0riPnmcaDzu2q 737z3M5rw7uG+HxiYvpRsAAAA X-Change-ID: 20260814-ktodo-si-cad1bd45ca07 X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2212; i=ariel@ariels.xyz; h=from:subject:message-id; bh=L+7nkvBt6EWdD/7kvuAv6BHHVC5flFHe68KVfr7krtE=; b=owGbwMvMwCX2lfHt4U0KtzwZT6slMWTVW9ZvuZcsErmn73PSpc2flkXKRb7c0p1s+nbTU92v+ pu4thRd7ChlYRDjYpAVU2SJtebJvP01wqnKpW8+zBxWJpAhDFycAjCRPfGMDN9MWNzLJDx7v5Yu bzsdPUHf6ds1oe0GnE9FG99t5u4v/cvwV87pvSBT0ZEN7h/UDkjcMDM45zTlQ3v2n7MqilfLYp5 GcgEA X-Developer-Key: i=ariel@ariels.xyz; a=openpgp; fpr=F3AB96E458C8098D8330A9FB52B66523B085EE81 From: Ariel Yu To: apw@canonical.com, joe@perches.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH] checkpatch: recognize standard SI unit prefixes and symbols Message-ID: <010601a000f8aa59-fa0e91fe-a069-4aaf-baa2-79737d25251a-000000@ap-northeast-1.amazonses.com> Content-Transfer-Encoding: quoted-printable Date: Fri, 14 Aug 2026 15:51:31 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Feedback-ID: :1.ap-northeast-1.mgmjTAb4xwNtpzB/mREvrmDZQ4OxUf0ABiHIN5l04830jQzqdlwGmixgGm7LBQvh3Kz2oC2td3ZcQFseAE2QdPZUOnVGoZ81dVKuFLncFOGtXIfvcMFT66YD6nPHHrfma6+bOqIeKVzUggBbRHUM6fVKU56vtKjTf78DNHTqfrMGdoXymh+08qzIIiH+aJBD:1.ap-northeast-1.DTXDV/V9GPBWozcllKo8innbNB2qs2O/3F8XZSzd9ZM=:AmazonSES X-SES-Outgoing: 2026.08.14-23.251.234.53 Content-Type: text/plain; charset="utf-8" The CAMELCASE check currently uses a broad [a-z][A-Z] pattern to skip SI-unit-style identifiers, which matches any lowercase-then- uppercase pair rather than actual SI units. Replace it with an explicit list of standard SI prefixes (u, n, m, k, K, M, G, T) and units (V, A, Hz, Ohm, C, K, s, W), while retaining the binary byte units (KiB, MiB, GiB) and dB. Link: https://lore.kernel.org/linux-iio/F9A182CC-62C0-445C-BAF0-9CDB7FFB386= 8@gmail.com/ Assisted-by: opencode:deepseek-v4-pro Signed-off-by: Ariel Yu --- scripts/checkpatch.pl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 2b7a42bbdd..ba76beafc3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5935,11 +5935,21 @@ sub process { $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && #Ignore ETHTOOL_LINK_MODE_ variants $var !~ /^ETHTOOL_LINK_MODE_/ && -#Ignore SI style variants like nS, mV and dB +#Ignore SI style variants like mV, uA, kHz, dB, MiB etc. #(ie: max_uV, regulator_min_uA_show, RANGE_mA_VALUE) - $var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?[a-z][A-Z](?:_[a-z0-9_]+|_[A-= Z0-9_]+)?$/ && -#Ignore some three character SI units explicitly, like MiB and KHz - $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) { +# +#Recognized standard SI unit prefixes (case sensitive): +# u - micro (10^-6) n - nano (10^-9) m - milli (10^-3) +# k - kilo (10^3) K - kilo (10^3) M - mega (10^6) +# G - giga (10^9) T - tera (10^12) +# +#Recognized units (optionally prefixed by the above): +# V - volt A - ampere Hz - hertz +# Ohm - ohm C - coulomb K - kelvin +# s - second W - watt +#Binary byte units: KiB, MiB, GiB (TiB) +#Decibel: dB + $var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?(?:[unmkKMGT]?(?:V|A|Hz|Ohm|C= |K|s|W)|[KMG]iB|dB)(?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/) { while ($var =3D~ m{\b($Ident)}g) { my $word =3D $1; next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/); --- base-commit: d58772d8520c7ef247c4b95c9bd76d3a25da9ff5 change-id: 20260814-ktodo-si-cad1bd45ca07 Best regards, -- =20 Ariel Yu