Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp1267625imc; Sun, 17 Mar 2019 08:51:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVSqSpRKYzUXWFj/AZZyAt3Yzv7sXFyVXuMrUslOIfTNBhFrIMYDmjpYnPTnONxFgtXnX1 X-Received: by 2002:a17:902:2a89:: with SMTP id j9mr14133076plb.272.1552837897704; Sun, 17 Mar 2019 08:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552837897; cv=none; d=google.com; s=arc-20160816; b=zbiSp8w29Az0rJXoMuoCAtyJyRFDzsvwBZ6oZIaN+7Fzin8I1LbvwgK5NdiVMi/Psw wsrh1l3UTOGPHPE/s+8YJ/UPgJ27rRtnX0oa4wX0u2C+X3KgT5bHJQ3/2srssHIJqgbc GuJprfV1AXjJTq6Kn+M1HkdXgJW2GMMhTxMlMZrXF+uzieOp2pond62sPFnyGqAN0c9r j8+2rwT72bNP7x8lxew8aXnOE4gA3eo91FQzFqszlIItwK1LkPOjAE9ohEQp46KIircz ZFT+ZFJfinC/Rq+3cg7QfVQ05fgiJLhIj82k1V2DTPGdxnkLLbFk7q1OlCKNKLjhyNNn DkxA== 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:references:to:from:subject; bh=kyRBAqGC3ijCV0hsbK1a53lc9GztzFKtrc94UL7/xVU=; b=ujve/oT+eDnRRsdZ4z4tYT/pUQcsxVnPeS26wpxS9/gPyqFdU/z8g6PxnL3Ya2lFDQ e7KD2xEcsSxMOEuj5PoNFxClzyI3wWg5reZKLM9Mxk2t1nYhqCWAzH5s1Ktj7TMYBu6q RgUKCUuV2GRRIaSniUemyqO/UWFBvh22qvU/i0PXBqeoCQk631kTYX/N0+3BMC1VILOf 88hLgjU/OhLexrWCTGzGfPWrdzkls7W7wJme4Uky8MEFyOmyb61obH9bmlupa87Nh5sy HcxIfrmLqkA/FqT/Hdl6fiHAcRtyGa56Wqu5PBhhOYRdlmjvAMcnLTB/KDKyH1V6jalI IlZA== 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 b8si6888309pgq.424.2019.03.17.08.51.22; Sun, 17 Mar 2019 08:51:37 -0700 (PDT) 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 S1727496AbfCQPs7 (ORCPT + 99 others); Sun, 17 Mar 2019 11:48:59 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:57287 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726812AbfCQPs7 (ORCPT ); Sun, 17 Mar 2019 11:48:59 -0400 Received: from [192.168.0.11] (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 92527200006; Sun, 17 Mar 2019 15:48:56 +0000 (UTC) Subject: Re: [PATCH] scripts: checkpatch: Check block comments start with /* empty line outside net From: Alex Ghiti To: Joe Perches , Andy Whitcroft , linux-kernel@vger.kernel.org References: <20190305180238.32630-1-alex@ghiti.fr> <4b86da69fc4460a9992a5d90fe2a1673c2fa4f37.camel@perches.com> <9d200724-6ca0-6412-7862-5166241bafa7@ghiti.fr> Message-ID: Date: Sun, 17 Mar 2019 11:48:56 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <9d200724-6ca0-6412-7862-5166241bafa7@ghiti.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: sv-FI Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/6/19 7:12 AM, Alexandre Ghiti wrote: > 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 > > Hi Joe, Can I do something more regarding this patch ? Thanks, Alex