Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3661274imb; Tue, 5 Mar 2019 15:44:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzinXFC4pyz2qkOQ1E19BQhC314Hg5hqjEO1gQbkurEsNJp5bCYPh+ULZwOVdClk8Eh3s9J X-Received: by 2002:a17:902:ea85:: with SMTP id cv5mr3744811plb.119.1551829465543; Tue, 05 Mar 2019 15:44:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551829465; cv=none; d=google.com; s=arc-20160816; b=moj/HfGM5ZPlJ5LBfusiv0HtAoiMoO3jhSurJONFA+WjedXBhR67zecfA/MSNdnwDn JUtl5fWF+CePoTgMGdDyWphyZV6jyZneNv1T0m3YawZowC2MBGx0yhcE2BeoA5wFpTK5 qMIUlQBBTC4RWafuhBXY97K59LnAO0dVMSqoVu8K0g+XMM6/n8SRTdoR5ZZEgrQPQo27 tdiEZRQYIoJ5tXcgEjbvPo31FL2uQah7Z6zKPzvCuOAAXwcHbkiG+aYQMasoPb3e4Uiq 7zf4ntsIvH2ck5NfQ8lnQXdFn20vljR64vDgiqxQePxfIJA8gVH0J9k1wd3A74Dq1TM7 exnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id; bh=v6lEqLTfZH4qUulQQQU31niKKKSR766ITI4wOmybSFI=; b=wDDbChb5Uspqlc/cZEEB0cqD8mVGzDuhjZwcBF7IUgEVQO3lLGHGIZCqV7FhzqRtAR kHRuVSYzD53aONbRnYxcivlHA/1Fg1tdKBSDsA9NOJNhFtTh9seo8ar0ydgwb7/mKECC 5F9MvCR8ZkGOwpPZyZ1dAA7Vh2+62kds9RsVKvzrN/wk7OjmesZ0Nm/MGVrMu1TpnEuV mIrC+V7uAri9x04CdPQ2gACHrTY3X1gYJiSRlrPhIj1swnx8LlkSaRU+b7g1TIQ7J/8j dI2esf+3vq6SDYG+D5UI1kZH0xjOFCAUv+/XghL3Dk7KIzdSWuXY9lV1z4+Bwi5TwRML c7Dg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d32si9872226pla.117.2019.03.05.15.44.10; Tue, 05 Mar 2019 15:44:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728698AbfCEXI2 (ORCPT + 99 others); Tue, 5 Mar 2019 18:08:28 -0500 Received: from smtprelay0176.hostedemail.com ([216.40.44.176]:60421 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726217AbfCEXI2 (ORCPT ); Tue, 5 Mar 2019 18:08:28 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 8D3BD100E86C3; Tue, 5 Mar 2019 23:08:26 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:599:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1381:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3653:3865:3866:3867:3870:3872:3874:4321:5007:6119:7808:7903:10004:10400:10848:11026:11232:11473:11658:11914:12555:12663:12740:12760:12895:13069:13255:13311:13357:13439:14181:14659:14721:21080:21451:21611:21627:21740:30012:30054:30070:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:42,LUA_SUMMARY:none X-HE-Tag: ring38_2c814995d2c38 X-Filterd-Recvd-Size: 2297 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA; Tue, 5 Mar 2019 23:08:25 +0000 (UTC) Message-ID: <4b86da69fc4460a9992a5d90fe2a1673c2fa4f37.camel@perches.com> Subject: Re: [PATCH] scripts: checkpatch: Check block comments start with /* empty line outside net From: Joe Perches To: Alexandre Ghiti , Andy Whitcroft , linux-kernel@vger.kernel.org Date: Tue, 05 Mar 2019 15:08:24 -0800 In-Reply-To: <20190305180238.32630-1-alex@ghiti.fr> References: <20190305180238.32630-1-alex@ghiti.fr> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-03-05 at 13:02 -0500, Alexandre Ghiti wrote: > This patch ensures that apart from net code, block comments start with an > empty /* line. I'm not sure it's useful to try to eliminate these types of lines as there are ~20K of them in the kernel $ git grep -P "^\/\*\s*\S" | \ grep -v "\*/\s*$" | \ grep -vP "^(drivers/net|net/)" | \ grep -vP "\/\*\**$" | \ wc -l 19437 Also, perhaps the code would be simpler using something like: --- scripts/checkpatch.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d0001fd1112d..c62dbd440c50 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3262,6 +3262,17 @@ sub process { "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev); } +# Block comments use an initial blank /* unless self contained single line +# or a continuous header line like /********************** +# This also allows for introductory kernel-doc /** lines + if ($realfile !~ m@(?:drivers/net|net/)@ && + $rawline =~ m@^\+\s*/\*(?:\s*\*++)?\s*\S@ && + $rawline !~ m@\*/\s*$@ && + $realline > 2) { + WARN("BLOCK_COMMENT_STYLE", + "Block comments start with only /* on an otherwise blank line\n" . $herecurr); + } + # Block comments use * on subsequent lines if ($prevline =~ /$;[ \t]*$/ && #ends in comment $prevrawline =~ /^\+.*?\/\*/ && #starting /*