Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp805590ybg; Wed, 10 Jun 2020 14:20:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsWCliBWiXZ/8SFwTQE2G57LSdtphDaOM3UYzoyZ9ET8+gueLEmRL8NeOim560GOw9ARH9 X-Received: by 2002:a17:906:5243:: with SMTP id y3mr5637712ejm.193.1591824046457; Wed, 10 Jun 2020 14:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591824046; cv=none; d=google.com; s=arc-20160816; b=gRnSZGd4kpHOY6xBIYwxpSAQ+VdwAo1BXVfLdT5/M3fxuXyc1cBXsuSQYEK6zeChde Wvv1mQFdcC7hdj5KJTpKS7Ru7lGHq1+2l1+rtC9C7mf0uTzCL7xn2OVtNLNzoKpL5PeQ 41JxhwKRm345AYnH+Sh/F1cYmFVu/FC2IAX9Rz60LjvLbEkzWmhmnAW6tQ1hoWqCJYXV AZlsSN/PpIWZRZGl0mK6rNw0tI9Khwevfc3ywupwEBDM4evio6EkmQFLnpELHZHCcP0l k/OJLN/JgQBV2wit8zTlz+DzYFwrIbWnsbTSMfH4vrn6rvDBJZUe/GfjBIS4CwLKheVD xoRw== 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:cc:to:from:subject :message-id; bh=TtyaTMCAz79wUGQk676lR5dDw97v/rL0k8BNT7ddV2c=; b=I5D6gsrLQVdw8qyT+kXx29AekcoG2c9AWKoltD65SzVvpg/bSWuBYTT7Wqwoy1al0Z nNU9xLhFozaku8xxKfU3GmE9vWKNko9y8qksh5caJMEwKJ68kbZvZ/S7yFoUFusMPM3C na4a73ZxAjEtcvl3fOMnJshL2wIx6K+ATuFS1A+tBbvQPCXuDEAC8A9hWl3XC+cP1Uh0 tMiRCADPPz0bVbv5Wm66Y6wA10ztUPQmvQfNv0Hb8HO4rTeTYgjqXO5Tch8S8dmtW62o ijg0tVRAvW6o9C+9e9MXVMQWskN+6zNBDDKMPzZy8VS0T4MGh6jQZIAmdfoNrzj+jtkQ 0UUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si487405edo.83.2020.06.10.14.20.23; Wed, 10 Jun 2020 14:20:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726307AbgFJVQH (ORCPT + 99 others); Wed, 10 Jun 2020 17:16:07 -0400 Received: from smtprelay0184.hostedemail.com ([216.40.44.184]:52228 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726266AbgFJVQG (ORCPT ); Wed, 10 Jun 2020 17:16:06 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 39D731803F92D; Wed, 10 Jun 2020 21:16:05 +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:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3870:3871:4321:5007:6691:7903:9707:10004:10400:10848:11026:11232:11473:11658:11914:12043:12114:12297:12438:12555:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21451:21627:21740:30012:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: ants08_1b02dec26dce X-Filterd-Recvd-Size: 2365 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA; Wed, 10 Jun 2020 21:16:04 +0000 (UTC) Message-ID: <673c2ebaf7a1ca93f3b1192a77ff62167badd896.camel@perches.com> Subject: Re: [PATCH] checkpatch: add check for NONNETWORKING_BLOCK_COMMENT_STYLE From: Joe Perches To: Scott Branden , Andy Whitcroft Cc: BCM Kernel Feedback , linux-kernel@vger.kernel.org Date: Wed, 10 Jun 2020 14:16:03 -0700 In-Reply-To: <20200610202640.9020-1-scott.branden@broadcom.com> References: <20200610202640.9020-1-scott.branden@broadcom.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.2-0ubuntu1 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 Wed, 2020-06-10 at 13:26 -0700, Scott Branden wrote: > NETWORKING_BLOCK_COMMENT_STYLE is supported by checkpatch but there > doesn't seem to be any check for the standard block comment style. > Add support for NONNETWORKING_BLOCK_COMMENT_STYLE to check for empty /* > on first line of non-networking block comments. I think there are _way_ too many instances of this form in non-networking code to enable this. $ git grep -P '^\s*/\*\s*\S.*[^\*][^\\]\s*$' -- '*.[ch]' | \ grep -v -P '^(drivers/net/|net/)' | \ wc -l 51407 (with a few false positives) Does anyone really care if non-network code uses this style? /* multiline * comment */ > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3408,6 +3408,16 @@ sub process { > "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev); > } > > +# Non-Networking with an empty initial /* > + if ($realfile !~ m@^(drivers/net/|net/)@ && > + $prevrawline =~ /^\+[ \t]*\/\*[ \t]/ && > + $prevrawline !~ /\*\/[ \t]*$/ && #no trailing */ > + $rawline =~ /^\+[ \t]*\*/ && > + $realline > 2) { > + WARN("NONNETWORKING_BLOCK_COMMENT_STYLE", > + "non-networking block comments use an empty /* on first line\n" . $hereprev); > + } > + > # Block comments use * on subsequent lines > if ($prevline =~ /$;[ \t]*$/ && #ends in comment > $prevrawline =~ /^\+.*?\/\*/ && #starting /*