From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C29EC41604 for ; Tue, 6 Oct 2020 08:42:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D38B20853 for ; Tue, 6 Oct 2020 08:42:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726006AbgJFIln (ORCPT ); Tue, 6 Oct 2020 04:41:43 -0400 Received: from smtprelay0039.hostedemail.com ([216.40.44.39]:41366 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725912AbgJFIln (ORCPT ); Tue, 6 Oct 2020 04:41:43 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id F1A551802E636; Tue, 6 Oct 2020 08:41:58 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: blood15_5b13f4f271c5 X-Filterd-Recvd-Size: 2753 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf10.hostedemail.com (Postfix) with ESMTPA; Tue, 6 Oct 2020 08:41:57 +0000 (UTC) Message-ID: <23e7b9e33738bfa1b1d1ac0ccd4d78235decaa30.camel@perches.com> Subject: Re: [PATCH v2] checkpatch: Fix false positive on empty block comment lines From: Joe Perches To: =?UTF-8?Q?=C5=81ukasz?= Stelmach , Andy Whitcroft , linux-kernel@vger.kernel.org, Andrew Morton Cc: =?UTF-8?Q?Bart=C5=82omiej_?= =?UTF-8?Q?=C5=BBolnierkiewicz?= , Marek Szyprowski Date: Tue, 06 Oct 2020 01:41:56 -0700 In-Reply-To: <20201006083509.19934-1-l.stelmach@samsung.com> References: <20201006083509.19934-1-l.stelmach@samsung.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-10-06 at 10:35 +0200, Łukasz Stelmach wrote: > To avoid false positives in presence of SPDX-License-Identifier in > networking files it is required to increase the leeway for empty block > comment lines by one line. > > For example, checking drivers/net/loopback.c which starts with > > // SPDX-License-Identifier: GPL-2.0-or-later > /* > * INET An implementation of the TCP/IP protocol suite for the LINUX > > rsults in an unnecessary warning > > WARNING: networking block comments don't use an empty /* line, use /* Comment... > +/* > + * INET An implementation of the TCP/IP protocol suite for the LINUX > > Signed-off-by: Łukasz Stelmach Thank Lukasz. Andrew, can you please pick this up? > --- > scripts/checkpatch.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Changes in v2: > - added example warning in the commit description > - added a comment in the code > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index a213cdb82ab0..3555ac812c99 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -3460,7 +3460,7 @@ sub process { > if ($realfile =~ m@^(drivers/net/|net/)@ && > $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ && > $rawline =~ /^\+[ \t]*\*/ && > - $realline > 2) { > + $realline > 3) { # Do not warn about the initial copyright comment block after SPDX-License-Identifier > WARN("NETWORKING_BLOCK_COMMENT_STYLE", > "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev); > }