Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4178630imb; Wed, 6 Mar 2019 07:13:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxMPEONTd+6oI/OEUtKthi8T199Yprp9IkMYaxz/J3F0crtvC+57BBsj7LZn9okeqtX20d3 X-Received: by 2002:aa7:8b17:: with SMTP id f23mr7777664pfd.171.1551885183627; Wed, 06 Mar 2019 07:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551885183; cv=none; d=google.com; s=arc-20160816; b=zu6xMH1f71ldNNG66VQxTDyEyiGApTp8IuOgMs4iLyXMn3RPPONjfhxMpfZhbFFhvc 1YTGnSKsttiLcxYrzuT/PhBUgqndLh3CAwCFhBA9Vgut0Fxsa/Ocb2hbpof/CY3eXXjK b9fJzdkb8Z0OSKF6G7xelsNkgn1ncM2+3oNOO1zeST1H9NB6/ldoM/8v0ZPvPLvhoSI7 fbbhcSNVnL4HTEouDQpnh4bStGo2wTMhBupvPIs8Bt/efV6KRrozT85g3tccLsYZ79e5 AE7DfOfonOTZT+w97/K9a9YKaS/I5aDELFmdrzSeGO4dLJDjJtCuL96PN86ZB/1rxrBW oz7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=5MYTDiLk70dOj9VzV3oANSHTg65L/lVnI/9xBMNvLhk=; b=x7P76bk1L3qsWQBGQ6qcjlT96g2f0evOQU/lcCU8rX/YNqU4mKY9X1Wy2FUK/8+c4C Nf6+pSvuymRkLW7W0nexdijNa1xf6evlMbdSw6X0ncHeO2J+KlmWEIEJkdB0Xi2uXW2p He8WVKjZtq/DBHBpwkJE2mug1QiVZ9lA5bfKGYI3kaq5H8WR3RWoeDNvXXT2W25plxR7 bWQqN1CvpULGPN4WxtBRUwhIZMALggqj9rPnFExtR9QfZE+KihNUdaiKML81xHrccuhk m199DQ+U/hYEiSAO751bP+8N/5siIjipe3ykaKSWEJlx2JtvYoRGLD5KsLzg8B/SK4ro rWKg== 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 e15si1601559pgk.488.2019.03.06.07.12.48; Wed, 06 Mar 2019 07:13:03 -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 S1730106AbfCFMML (ORCPT + 99 others); Wed, 6 Mar 2019 07:12:11 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:60055 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730041AbfCFMML (ORCPT ); Wed, 6 Mar 2019 07:12:11 -0500 Received: from [10.30.1.20] (lneuilly-657-1-5-103.w81-250.abo.wanadoo.fr [81.250.144.103]) (Authenticated sender: alex@ghiti.fr) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 43EE2240004; Wed, 6 Mar 2019 12:12:09 +0000 (UTC) Subject: Re: [PATCH] scripts: checkpatch: Check block comments start with /* empty line outside net To: Joe Perches , Andy Whitcroft , linux-kernel@vger.kernel.org References: <20190305180238.32630-1-alex@ghiti.fr> <4b86da69fc4460a9992a5d90fe2a1673c2fa4f37.camel@perches.com> From: Alexandre Ghiti Message-ID: <9d200724-6ca0-6412-7862-5166241bafa7@ghiti.fr> Date: Wed, 6 Mar 2019 13:12:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.2 MIME-Version: 1.0 In-Reply-To: <4b86da69fc4460a9992a5d90fe2a1673c2fa4f37.camel@perches.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 3/6/19 à 12:08 AM, Joe Perches a écrit : > 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 This is part of the coding style, some people rely on checkpatch for this matter, so I think we should at least warn user, that would avoid patch bouncing. > > 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 /* > > Your version handles more cases, but why is it simpler ? Anyway, that's ok for me if you prefer your version. Thanks for your comments, Alex