From nobody Fri Dec 19 20:51:14 2025 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (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 08C5E1547EE for ; Wed, 15 Oct 2025 17:51:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760550719; cv=none; b=SOgWg2URU1Ab+5UNXm5fPDawKrCIo1rOYvuwLLtcCQ9Aye4swCtQbFCb9IMjRCxslXmOZw1JzxV6hx6d4jkN04vix8BFkF5Npq6uzbQPNC22BVz8tNzaG2phsVYuBl6VIp/vK532khlqcMhn9sFxiJNG5ptBpT222fCrfM7kD4A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760550719; c=relaxed/simple; bh=lPYMbvNrCKwF3KYux8mZ2rfVctaCAtZ2gSS3vkjfJko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bqMcr0S9WlJn8Cs/iXI9jbC27DmxYvM92pl8EVgdFn15WN+imL8GrNwYZDd0kg1qtmcP9swaNlySBtdA9OYm35cysGviDvQgf0uL0opxX687T1Jhc+Ww/sLs4XAGaxlGTYZYeiEJhpDThE999RPLSVxCHpdO6Xi5rGSIca7Vv2w= 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=njnggtlX; arc=none smtp.client-ip=209.85.166.180 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="njnggtlX" Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-430a4bf6b6dso5948725ab.0 for ; Wed, 15 Oct 2025 10:51:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760550717; x=1761155517; 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=5jkbuW2RngRwKTXR8TmZtG5NMUGcZxQdiAE8KdN0MfM=; b=njnggtlXsbPc0xwGpEHj/dwi+u72IlmTZ/t0BndM5bsDwlDSJ7kK1JeUpPfy4DUD5T QzBAHxwlETqn6Kk+HmiLSJVGIxAy8MYlvev2OP9p+Kqj0/wkUxdp3XbZTX/vb/19yzwD TJvonwUAd4A9oloByqHZtLZ64LecbfSBMT7O7qzPPCH+T3S3DPb/bmqNZEwthT8q54re X/UvK8mUaoLd7bD3NnUwHbGCXBxnaoLWk4RR/Rz+/MSnzeocpuhyp+pgaM9WRovPjDM2 RIVDE8FUe6GezUilofwMJBaxkB/cm5uCK/94eYkeJ1gS20T3WVaMwcispljg1WCHqn+g lVdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760550717; x=1761155517; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5jkbuW2RngRwKTXR8TmZtG5NMUGcZxQdiAE8KdN0MfM=; b=RX0T/z2RkSa7lsHiwSyYe7hCn8JjYNxcCAVI5M57d+hcl4XOpTWGhKEot85VsijNYa mAtDXflnxUzX1Kc/NXf91f9brFaGA0Ww2BSkXKJMaoAMTYFEj9H1NeCHs152F+6LOPHE A70PZW3l0RrcahZy56CCPviv42nirdbnIWZUnvuHX6fRQPWypEmsN2xVGXzjU15sZo4/ w7RiuEP6ohi8NucEgWqKDocEUV+0S8txE4cKATN+j87WzCi8gyY3KgPUiB3kV9dzrodB qu7c8+5+kOcOCTpOvCu0NNNxMRTL5IT85sZqnvoFr67clmVpODpPpXdkmzbOGv+1Bozt VxgQ== X-Gm-Message-State: AOJu0YzyLNbFByb2RijllfQGm1RlULCEd76LAibeSQBAlivYEAIcc3hZ RiqdygiJABGBftEETCT4g1sDYbbGV69caP2Dibu1SjnCZzqNhrGyOGLjYHJ7fg== X-Gm-Gg: ASbGnctvI66philz9TBAOLW5SaITxPpnRH5lCJPLIHLi34HQRd4rSK3V0IDEeilo7eH c6KDsUQ57iYVjJxCO6rZN4EDGgcxu7eMkuiHQVXWhHItfO4sHVP4PLyQcINehT1p+dpnP0R5xdt l/YE/qS9yGmosn9SlF/F/75JmHnJ45ybO+JQk5QhFKFEDECoBGbRZ5ONfJKY82y9kWwbhfq4DiF b1SJ7pBN6kE+xwYv4lSCpr64m/G/7QCT8bA4Tt6oDy6Fw7kTTbjg28CrNiR54EdZmMbf92J+fQ+ kntYKxihwr5BJzSoklVAsus6dXqhsOu6ZLQFH7RVE4PBtozvexWucpAEWWSNPrgjf+OkfvYs5TQ ckM8/P7Oy2hcDOv2CsdT8jEDMXSTEkoN7pfXIaNgog6lqkCeNg2s4V44heu1lmoa/+gn48hVrPe ZX35t9sxl8FDU4BjLRNdYHgw== X-Google-Smtp-Source: AGHT+IEvaQe82SwDWzcV90P2IirCokgb7oZvT7Bl9uSrEXZMkppw6Ma++mOxFMWU1eCIzUncs3ivNA== X-Received: by 2002:a05:6e02:170b:b0:425:7788:871 with SMTP id e9e14a558f8ab-430b437e76dmr15724505ab.12.1760550716774; Wed, 15 Oct 2025 10:51:56 -0700 (PDT) Received: from godzilla.raven-morpho.ts.net (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id e9e14a558f8ab-430b50b692csm1194115ab.5.2025.10.15.10.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 10:51:56 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [RFC PATCH 1/2] checkpatch: add __no_side_effects() hint/assertion macro Date: Wed, 15 Oct 2025 11:51:36 -0600 Message-ID: <20251015175137.2178263-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015175137.2178263-1-jim.cromie@gmail.com> References: <20251015175137.2178263-1-jim.cromie@gmail.com> 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" Depending upon your macros, `checkpatch --strict` may issue many warnings like: CHECK: Macro argument reuse '_var' - possible side-effects? In (at least) 2 cases, the usual advice to use ({ typeof .. }) or do{}while(0) does not apply: 1. top-of-scope (inc file-scope) declarative macros: #define module_param_named(name, value, type, perm) = \ param_check_##type(name, &(value)); \ module_param_cb(name, ¶m_ops_##type, &value, perm); \ __MODULE_PARM_TYPE(name, #type) Given this macro-defn, checkpatch would carp about name and value. Note that it wouldn't complain about type, even though type is expanded 3 times, because it knew to strip # and ## constructs before counting args. 2. #define for_simplicity(_i, _lim, ...) \ for( _i =3D 0, _i < _lim; _i++ ) /* your loop body here */ Though not a compelling example, it should'nt be impossible. ({}) fails because () detaches the expansion from the following { block }. And the do-while adds a ';'. So allow a macro author to assert that (_i) is safe to expand 2+ times: #define for_simplicity(_i, _lim, ...) \ __no_side_effects(_i) \ for( _i =3D 0, _i < _lim; _i++ ) This should help reduce auto-QA/pre-review noise, even though its a homely little macro. It has 2 parts: 1. compiler.h: #define __no_side_effects(...) /* nothing */ so no functional change from its use. authors add it to "noisy" macros readily reviewable, and marked for it by name. 2. checkpatch: suppress the CHECK reporting: a. find the hint in macro body, capture the safe-args (_i, _j) b. strip the hint, reflecting the /* nothing */ above c. before issuing CHK() on arg-use-count > 1, skip if /safe-args/ 3. --drx option, which enables a new sub drx_print("reason"); a. used like: s/$pattern/drx_print("why")/e; b. calls it on 3 existing cases. Here it is in action, on a patch that prompted this one: drx_print: strip 'arg ##' catenations >> Matched (`$&`): <_var##> drx_print: strip 'arg ##' catenations >> Matched (`$&`): <_var##> drx_print: strip 'arg ##' catenations >> Matched (`$&`): <_var##> drx_print: dunno >> Matched (`$&`): <__builtin_constant_p(cls> >> Capture 1 (`$1`): <__builtin_constant_p> drx_print: dunno >> Matched (`$&`): <##_model> >> Capture 1 (`$1`): <##> drx_print: dunno >> Matched (`$&`): <##_model> >> Capture 1 (`$1`): <##> drx_print: dunno >> Matched (`$&`): <##_model> >> Capture 1 (`$1`): <##> drx_print: dunno >> Matched (`$&`): <##_model> >> Capture 1 (`$1`): <##> drx_print: dunno >> Matched (`$&`): <##_model> >> Capture 1 (`$1`): <##> drx_print: dunno >> Matched (`$&`): <##_model> >> Capture 1 (`$1`): <##> drx_print: strip '#|## arg catenations >> Matched (`$&`): <#_flags> drx_print: strip 'arg ##' catenations >> Matched (`$&`): <_flags##> drx_print: strip 'arg ##' catenations >> Matched (`$&`): <_flags##> drx_print: strip 'arg ##' catenations >> Matched (`$&`): <_flags##> total: 0 errors, 0 warnings, 712 lines checked This should be useful for hacking at checkpatch if/when the behavior of an existing s/// or s///g is sufficiently mysterious that a few s//drx_print("wtf")/ge modifications seem appropriate. Some of them will be worth keeping, since the "reason" can be inspected, improved, verified by using --drx as needed. NOTES: This adds to the stack of heuristics: cpp doesn't mind expanding i++, so checkpatch is paranoid; this quiets that paranoia clearly. The macro call must *exclude* the trailing semi-colon. practicality vs aesthetics. Is less QA-noise worth the ugly ? TODO: The "dunno" case shouldn't really catch the <##_model>, since there's a subsequent rule for that. I could have hidden this blemish by moving the other rules up, but that also hides a maybe over-broad stripping regex, and is -E_TOO_MANY_CHANGES. Signed-off-by: Jim Cromie fix --- include/linux/compiler.h | 12 +++++++++++ scripts/checkpatch.pl | 46 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 64ff73c533e5..a348b45eacc0 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -379,6 +379,18 @@ static inline void *offset_to_ptr(const int *off) */ #define prevent_tail_call_optimization() mb() =20 +/* + * tell checkpatch --strict that you know the named args (a subset of + * the containing macro's args) are safe for multiple expansions. + * + * Prefer ({ typeof ..}) or do{}while(0) when they work. They would + * not work on module_param_named(name, value, type, perm), or on a + * locally useful "for_simplicity()" macro. + * + * NB: use at top of macro body, omit trailing semicolon. + */ +#define __no_side_effects(...) /* checkpatch "annotation" helper */ + #include =20 #endif /* __LINUX_COMPILER_H */ diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e722dd6fa8ef..27299f326804 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -169,6 +169,30 @@ my $DO_WHILE_0_ADVICE =3D q{ Enjoy this qualification while we work to improve our heuristics. }; =20 +# call this from s/$patt/drx_print("why")/e - to see whats happening there. +my $drx_print =3D 0; +sub drx_print { + return "" unless $drx_print; + + my ($why) =3D @_; + # The magic regex variables are available here. + # $& contains the entire matched string. + # $1, $2, etc. contain captured groups. + print "drx_print: $why\n"; + print " >> Matched (`\$&`): <$&>\n"; + + # Only print captures if they exist + if (defined $1) { + print " >> Capture 1 (`\$1`): <$1>\n"; + } + if (defined $2) { + print " >> Capture 2 (`\$2`): <$2>\n"; + } + # The subroutine must return the replacement string. + # For stripping, this is an empty string. + return ""; +} + sub uniq { my %seen; return grep { !$seen{$_}++ } @_; @@ -348,6 +372,7 @@ GetOptions( 'no-color' =3D> \$color, #keep old behaviors of -nocolor 'nocolor' =3D> \$color, #keep old behaviors of -nocolor 'kconfig-prefix=3Ds' =3D> \${CONFIG_}, + 'drx' =3D> \$drx_print, 'h|help' =3D> \$help, 'version' =3D> \$help ) or $help =3D 2; @@ -6044,11 +6069,24 @@ sub process { next if ($arg =3D~ /\.\.\./); next if ($arg =3D~ /^type$/i); my $tmp_stmt =3D $define_stmt; - $tmp_stmt =3D~ s/\b(__must_be_array|offsetof|sizeof|sizeof_field|__str= ingify|typeof|__typeof__|__builtin\w+|typecheck\s*\(\s*$Type\s*,|\#+)\s*\(*= \s*$arg\s*\)*\b//g; - $tmp_stmt =3D~ s/\#+\s*$arg\b//g; - $tmp_stmt =3D~ s/\b$arg\s*\#\#//g; + + $tmp_stmt =3D~ s{ + \b(__must_be_array|offsetof|sizeof|sizeof_field|__stringify| + typeof|__typeof__|__builtin\w+|typecheck + \s*\(\s*$Type\s*,|\#+)\s*\(*\s*$arg\s*\)*\b } + { + drx_print("dunno"); + }xge; + + $tmp_stmt =3D~ s/\#+\s*$arg\b/drx_print("strip '#|## arg catenations")= /ge; + $tmp_stmt =3D~ s/\b$arg\s*\#\#/drx_print("strip 'arg ##' catenations")= ;/ge; + + my $no_side_effect_vars =3D ""; + if ($tmp_stmt =3D~ s/__no_side_effects\((.+)\)//) { + $no_side_effect_vars =3D $1; + } my $use_cnt =3D () =3D $tmp_stmt =3D~ /\b$arg\b/g; - if ($use_cnt > 1) { + if ($use_cnt > 1 and $no_side_effect_vars !~ m/\b$arg\b/) { CHK("MACRO_ARG_REUSE", "Macro argument reuse '$arg' - possible side-effects?\n" . "$here= ctx"); } --=20 2.51.0 From nobody Fri Dec 19 20:51:14 2025 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (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 3DFD82FFDD5 for ; Wed, 15 Oct 2025 17:51:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760550720; cv=none; b=oiZNJgtaT6r2DJxpZURjT7pMPBPO+mfut1gcglh4284HfmA/X95N20qF1miWLedZwFkXGVzPcVL6+k6uEVK5prJddcbS4jJVVN+n1WD24klk2+mLxAuOzCHY8LHaRAEPBj1VBOmR/4sS35tLUfEIPDfd767SbVoFVT/tIjiya0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760550720; c=relaxed/simple; bh=o8PqTXOgJWd/s/ikGi+5sDegbwwIZbEWqoF+5kl66v8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f9ywWx2///m7ivPcNcAK7Vs9ltGTR/EzD54OXvodmjLnAvecM27Q1/gtR08kPxB+QLNotEzapwSJ9pd1nw477VKEKvNg+0/qqKCBuZMOEMmkJa9tynKdvHiZSuQbkcIuwGkfTtxv3RYlVqKJ6YqXKsNE4DW0YgwYFcgAQn59uDs= 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=GNsxRpdy; arc=none smtp.client-ip=209.85.166.42 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="GNsxRpdy" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-93b9022d037so284481739f.2 for ; Wed, 15 Oct 2025 10:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760550718; x=1761155518; 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=ei8wrQpcijHhyCQBFmPmC4ESXYvigXWE+9ruQpjaX0I=; b=GNsxRpdyV2GKQNIJUWDRLqbxEyaRAN4VVe/fD7fe7aqS0RpdWuPyXDHxNlhddj6KZJ lOhD4F3tMaN70mE80+9ctrtQp9c8iDLpdQiqdRZ0OS22gUscBaZynpV9pmbp4Gf1Tsay C67LTaWbIuZAqy/m5qwezCnkOAw3rM4yKgvO1SNJso8BQgOvVB/6UgNeDPQZpRT/sGfi 5XnVtrV77+xfk34Yr1UBNwTMrx4cbYIjkfc+CtehSPszZOTHxXqRxwqMuP3qz/b7/a6D DLuf4uTI3Tw529HmCyjDdgEbYcD6WunCPZZMT0OlAOr/Qr7icMoJa5w+DgrlMnciNO6R 7wdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760550718; x=1761155518; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ei8wrQpcijHhyCQBFmPmC4ESXYvigXWE+9ruQpjaX0I=; b=BgebZEe1VDcl2mPADPovD1/9qVwuuvUrRWON+Bh/HDagfyKi8jsuJxP6xVGjpzx68r D/gxnXUPTPJC9BKWvoUigHLP6XEiR2A1NXqEiTfgD5PBF7giIln68saX/F7golUr3KQr tuQCLBRkDPDqsCqhEsze6iUfo87o7aRW0DKYoozNx0yQote7HsVZV8/aezKHhMBeJnIa 2pzF1ktZH/D6OGWcodfKqpHOQvlq5TeJfGk6bcC/k+kKQ21u/FdeaxUyIK0nijf7x8kr U2w5ld74DO3LXVcwQK+CBj9ygNVXGt3LDH1xNeyxosbIcYqhqWqnVUchwqUMmK2EStXZ G77Q== X-Gm-Message-State: AOJu0YwlUJe3/C4mpnGBGG1L/trDZPmzvjjDSVTv83eDfgKodGhwfHx4 PWfGRH0Q771TxLJp+2EE636hqFcGzRcnXXxD1z4J6XaMw4NL13kVQzU1Rkh7kA== X-Gm-Gg: ASbGncvc4/cROflNl3vqagPYMoBhItfh2HVBrdjg/a6IDwdXpNXmeZv3geKoLtSpHb+ jiGudqF8HqLOh5oBVCUTeCiVf0O8bqVFUI4wXv4YR6eNgug5knGletpU9ClVKsqZr4HgcxOSTp/ udtDCo5miwQW7tuuTk6YJNyKz995uQQ0L/qN28aRPO/hfNILu9AnDeqas03cTSo1kM+DfnrKOOg uzmEFc2qxD3LTRLvWJbUvccMl7NgXCUTCiHlPu94+OojZbpLF33HZH6RdwhBZnNu3qr4JSbY0CT qXu5uoMRGjrGORAqaZZypAqBrD+WEzP5gpCoFiVzubMbJesTIMKnsu/gC2Um37m5kaWCLMX7Nwz 8iCDm4j697CAP6+gEYrnCkvReJ35GQTuWgtZe/QfWZOG6jhxnKhMxJ0eNHY6GjNImWdYLyfUmfe wOPZuIUJdShy5vZr8QaA9Udw== X-Google-Smtp-Source: AGHT+IHHfB1pctNQwkeMCTwIAO2gi3XQr+rEka4h1CVVNHJM0Gat2jBZVlxrA3gyDHn/33vFGw4znA== X-Received: by 2002:a05:6e02:2513:b0:42f:91ac:bd5 with SMTP id e9e14a558f8ab-42f91ac0ca9mr246872325ab.19.1760550717804; Wed, 15 Oct 2025 10:51:57 -0700 (PDT) Received: from godzilla.raven-morpho.ts.net (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id e9e14a558f8ab-430b50b692csm1194115ab.5.2025.10.15.10.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Oct 2025 10:51:57 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [RFC PATCH 2/2] checkpatch: cosmetic-style tweak Date: Wed, 15 Oct 2025 11:51:37 -0600 Message-ID: <20251015175137.2178263-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251015175137.2178263-1-jim.cromie@gmail.com> References: <20251015175137.2178263-1-jim.cromie@gmail.com> 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" no functional change, slightly narrower on-screen, maybe clearer ? Signed-off-by: Jim Cromie --- scripts/checkpatch.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 27299f326804..4449e809ef6f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4019,11 +4019,13 @@ sub process { if ($newindent ne $goodtabindent && $newindent ne $goodspaceindent) { =20 - if (CHK("PARENTHESIS_ALIGNMENT", - "Alignment should match open parenthesis\n" . $hereprev) && - $fix && $line =3D~ /^\+/) { + CHK("PARENTHESIS_ALIGNMENT", + "Alignment should match open parenthesis\n" . $hereprev) + and do { + if ($fix && $line =3D~ /^\+/) { $fixed[$fixlinenr] =3D~ s/^\+[ \t]*/\+$goodtabindent/; + } } } } --=20 2.51.0