Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1103138rdb; Fri, 22 Dec 2023 15:16:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHY/MBl+nEYiMRkWPFOsk0LNYDN1MWrRjpP4iFLY57jFZyayglp1AX80lVYwZvhJM8XAK/1 X-Received: by 2002:a17:902:d50d:b0:1d4:2c5e:c3cc with SMTP id b13-20020a170902d50d00b001d42c5ec3ccmr661581plg.132.1703286976614; Fri, 22 Dec 2023 15:16:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703286976; cv=none; d=google.com; s=arc-20160816; b=K4f8ZKmFVrkQzMtC2iu/nghlnoybGKozE4JfxQ13aXiQX5PB70wmnnE7a2TD6BJVdL lf5dfLUpHn86LkZXtKC1fg8ArTqxMDwmrJPEUpfCa4xa8YYzsB618ngJdyeJfKfzCtBX JvjSm2ZxrjMxe25gUjRpHdnC/EcNYc54eYa2O9V+uP6okzrc4Rnp2IBuAPQ/LRd6GqPJ y4Chmx9aViEfV2Scpa6CHSfuSkxGg8/lbPsFVY8YL3q0RXmiia7TjVbjwsPGU5il1ymw qnaQuurIYqm7IbWtFUAL1fk7seoY1G/HLtoA8RmA0krWSe7nyjuxAQDPzlUCkq5srbW9 xGOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id; bh=IuoOmUeAgxxyi/OXu8Iij800sG1FNhsOqsB4+sPdH5A=; fh=8rwG2AA2I+AiEW+iFsL5a1E+2jsOFDAGsnG4OtUA+jI=; b=rzO1ofzFUrHsHCkSMX9UvvSxyYX9iDdS3oSXD/T/DLuN0/f7R4X2CnZ5FonffV1FIL NZMLSAPsaa9AO83ZhKy15seFdpase5JqRX1S+zDmrxPQaRBn6ExHoQuJhmXLvUMfUEka zAn8/38Le2RvZeLgICoNbeKxEFMSUbBEKfu1tkWKqVC64cj3GE9zMJp4HefkXRlMbq4G CYJ993Ql0cHtX9pXHY6F9cQoDG0YxwhhXe41ajtTLztae0B9nwlqb1Na+CWPzWD++DDZ K2mkGkPHuFxvLbe7oxW7/+5nY3EK8f9vPDchljtugzqgxLMzcuvXrJGU/6uMnktjYm/J 7h5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-10109-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10109-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u9-20020a17090282c900b001d09c96ba10si459090plz.447.2023.12.22.15.16.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 15:16:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10109-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-10109-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10109-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1F923284CB0 for ; Fri, 22 Dec 2023 23:16:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4427E35F0E; Fri, 22 Dec 2023 23:16:04 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4212335F08 for ; Fri, 22 Dec 2023 23:16:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=perches.com Received: from omf14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 25AC91C18F6; Fri, 22 Dec 2023 23:15:55 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf14.hostedemail.com (Postfix) with ESMTPA id 1B2202F; Fri, 22 Dec 2023 23:15:52 +0000 (UTC) Message-ID: <2b294dc33ea64d1d605cf146741d92677b13006a.camel@perches.com> Subject: Re: [PATCH] checkpatch: ignore deleted lines for comment context From: Joe Perches To: Andreas Dilger , Andy Whitcroft Cc: linux-kernel@vger.kernel.org, Andreas Dilger Date: Fri, 22 Dec 2023 15:15:52 -0800 In-Reply-To: <20231222230551.95425-1-adilger@whamcloud.com> References: <20231222230551.95425-1-adilger@whamcloud.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Queue-Id: 1B2202F X-Stat-Signature: 5yyep1gtej9546mqjphbfijenq453ew5 X-Rspamd-Server: rspamout05 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18+H6BsdhjeerElRaYNGOIFSDXjpfyiOjg= X-HE-Tag: 1703286952-821529 X-HE-Meta: U2FsdGVkX18dC6vbJYTiWeNzbzEaTsD/YvjoDuhszMpjmaknWpG43WBy0u1en70s2QJyT+nXawavE4dTXsTBsr+1Dwg8C2bYDfG0usEW5T8YVBTFp3HK1S9K49Zg4NrG1c2yqiMe7DWMd4gCASoGQPHY3JAkt49lXkZAkzkRyljcohT7qYnyUlhI+LVw53oH9R8xn6LmK4NmlSvAs3kwySTL/StH5TSG9Ruws7RXo9bAOTp+eaLpkPNBdXyvP88Ry2+tyfp7hJ+zBXHbKqjz2WeYsthQNeT5yyB0W9tivSTvZ/DbhmuNguJnrHGwnhU16PJdWghGbx38W2y5Rvuk631YC3y1n38PLYmNR0e6GS8aWaTu+3OzUPcLbv7w+i6D On Fri, 2023-12-22 at 16:05 -0700, Andreas Dilger wrote: > From: Andreas Dilger >=20 > Don't consider lines being removed by a patch as part of a comment. > Otherwise, false "WARNING: memory barrier without comment" and similar > issues can be reported when a comment does exist on the previous line. >=20 > For example, a change like below was previously incorrectly flagged: >=20 > /* matched by smp_store_release() in some_function() */ > - if (smp_load_acquire(&list->tail) =3D=3D head)) > + if (smp_load_acquire(&list->tail) =3D=3D head) && flags =3D=3D 0) >=20 > Signed-off-by: Andreas Dilger OK, but: > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -1972,7 +1972,8 @@ sub ctx_locate_comment { > $current_comment =3D ''; > for (my $linenr =3D $first_line; $linenr < $end_line; $linenr++) { > my $line =3D $rawlines[$linenr - 1]; > - #warn " $line\n"; > + #warn "LINE($linenr): $line\n"; This is a superfluous change > + next if ($line =3D~ /^-/); # ignore lines removed by patch > if ($linenr =3D=3D $first_line and $line =3D~ m@^.\s*\*@) { > $in_comment =3D 1; > }