Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp831595ybg; Wed, 10 Jun 2020 15:10:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHrDgWIhp0AUsy2y3qLRO2Lt5RV2wHGp16UuAGiideKa6JSfTRsVJKvqAB+1nwJ8xzenTN X-Received: by 2002:a17:906:4f94:: with SMTP id o20mr5281434eju.113.1591827045352; Wed, 10 Jun 2020 15:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591827045; cv=none; d=google.com; s=arc-20160816; b=L8j/scif6WY4GRoDwHKZCEGEwQoPoIvvI3FsYI0tVWFs6QbpIPECm0/aad5XOaSTH+ 2014bkAXGVmoiv6Pcyon//CXbeJOdVj617WsAcNs8N4Zbh7kL3BiSpRbSFC7gR6QzY3E xN0V4o03hs+3BydW1jaCMateNOnymDdBnP57bea65+5OdulO/AoP07DMI5o3p51dZkE3 LqOYXspjoBoo5gEYsWn6WO4PNgv0/rsJPePIDGWBs0aQCQ++AUhPDBYJ305WmjneO2gZ Mddjs59bi9ys0qrFi9ZY7JglpgQIdwDT36bdjN/8zYZlx9pIRkuqO7Z+M1i0kT1MDC1w woJw== 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:cc:to:subject:dkim-signature; bh=19F1c5tK8C2QSbXhWszFDt5PVrxpZGDspM0tZaWiDN0=; b=tRABt5z4bOjsBIjPuDnc10UYTAZmj6IxYsNvzJ4YXgfdMRl3YzGGUt5uVmWV70rFPz aeZR0fRh1wfTHgq6kab81Jx8eTbGiKIu1vipX2faESn3I46EYerUHrWxxBIspTdB1fAX txmi5CQ0DyTO3eUsTPnBfftwKQhUnDM/Id4s83MOi18zyl+syPFFZm8DYm8MRTFI+d4G eMTmKzO5pfPW/zNq1fvYGnqK5GBS1fHoa7KEI352s2DJKdFfnz4WZhRHkfGhr0E9kTsN SynTjUDXrpqDku0oenCT99MAhB/ElT1ZI1bcTqoQnbqESzb/8C6jf+CFJp6zdallUgt5 AJUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=O3HdXX6o; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id md3si750956ejb.206.2020.06.10.15.10.23; Wed, 10 Jun 2020 15:10:45 -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; dkim=pass header.i=@broadcom.com header.s=google header.b=O3HdXX6o; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbgFJWIi (ORCPT + 99 others); Wed, 10 Jun 2020 18:08:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbgFJWIh (ORCPT ); Wed, 10 Jun 2020 18:08:37 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67EAAC03E96B for ; Wed, 10 Jun 2020 15:08:37 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id h5so4049620wrc.7 for ; Wed, 10 Jun 2020 15:08:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=19F1c5tK8C2QSbXhWszFDt5PVrxpZGDspM0tZaWiDN0=; b=O3HdXX6oBXMtKU68PjHmYMXinaDsBwRo5APrlMrdrONOCSSFxgNKIJbpYOF+K4a4it tMRd6K/fQlV12cYUOrLYZPgOfUhxMAdmTb5AaMoKzCcJ95UpJlR4LwZicfsMv/a9VuXn ZUMJzt9yEqQCtiHduhSsEvFfFUXyjjjMfKPgs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=19F1c5tK8C2QSbXhWszFDt5PVrxpZGDspM0tZaWiDN0=; b=BluP66cBkSPZKEnsBImoG2/9I9XICSy1Xga/WE0KHKVbfF1rz3HHnZgrQNgFmaTugt 9fOfZRF+6WoBXQdqJjMgJHfRrXudfq0mvvtSQ/o4aXYSOnqq63ZIIloxQayo/5DSz4rn 7Lt0LdcHSwXOLjHw4rfqCRGnf6AQ1u4F0ddleZRY/uyhCJnOxv6tZL8jKbHq7YgR0mpi VUY0cGwmRp4tW3Mep+LZW6ZTpP7F/WrBQTJfUPZJ6F6mWyQSHxg/ecGlKrH9I9eVCIpP af+KJHNLcwmQlmLmtd3L83BunQ9ErJOGQGOBYSQ022BIBacVsy/0Qp2ObeRNrZLZWKAj v6Qw== X-Gm-Message-State: AOAM530igPEiNey0l5h7XEVaa5107x5XZQh8F6PRLID3M4dV4i93DA8e zFXz32ioXxqvX42JRtaoCl3f3Q== X-Received: by 2002:a5d:44cf:: with SMTP id z15mr6285785wrr.164.1591826915914; Wed, 10 Jun 2020 15:08:35 -0700 (PDT) Received: from [10.136.13.65] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id k12sm1713319wrn.42.2020.06.10.15.08.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jun 2020 15:08:35 -0700 (PDT) Subject: Re: [PATCH] checkpatch: add check for NONNETWORKING_BLOCK_COMMENT_STYLE To: Joe Perches , Andy Whitcroft Cc: BCM Kernel Feedback , linux-kernel@vger.kernel.org, Andrew Morton References: <20200610202640.9020-1-scott.branden@broadcom.com> <673c2ebaf7a1ca93f3b1192a77ff62167badd896.camel@perches.com> <021da2ca-a8d3-d0ad-28c3-6a84464353fd@broadcom.com> <33204a397b2d9316e09ae9829e637894b304ea00.camel@perches.com> From: Scott Branden Message-ID: <0f037983-6dad-859c-3ded-f7a0c86953df@broadcom.com> Date: Wed, 10 Jun 2020 15:08:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <33204a397b2d9316e09ae9829e637894b304ea00.camel@perches.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joe, On 2020-06-10 2:42 p.m., Joe Perches wrote: > On Wed, 2020-06-10 at 14:33 -0700, Scott Branden wrote: >> Hi Joe, >> >> On 2020-06-10 2:16 p.m., Joe Perches wrote: >>> 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 >> That is true about many things that checkpatch now checks for that >> didn't previously. > Not in that quantity of uses it doesn't. > > I specifically did _not_ add this very same test > when I added the other comment tests. > >> But, by adding to checkpatch the coding style clearly outlined in >> coding-style.rst can be followed: > Well, because there are _so_ many false positives > that don't need change, I'm not adding this. > > As is, I'm nacking it. > > If you need it for your use, you should keep it in > your own tree. I think this has value for others. > >>>> 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); > _Maybe_ this test _might_ be useful if it did a file/patch > test and used CHK on file, but even then I'm very dubious. > > my $msg_level = \&WARN; > $msg_level = \&CHK if ($file); > &{msg_level}(etc...) I can make such change. As is, checkpatch basically follows the coding style documented for networking and has no check for outside. I do not know the history of the 2 block coding styles but here's a radical thought: Change the coding-style document to pick a single coding style for ALL block comment styles and use that going forward in checkpatch instead? > >