Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp778070ybg; Wed, 10 Jun 2020 13:29:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoSQcDHSHGhFaMxCt9TfzLqH6p2J/T2aQyjrzg24qzUYj7PSk0CUv5T68goxNcnTivYmvQ X-Received: by 2002:aa7:d985:: with SMTP id u5mr4280605eds.160.1591820980540; Wed, 10 Jun 2020 13:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591820980; cv=none; d=google.com; s=arc-20160816; b=qbfwU45PCBej8btYCAG0Ww6GaqSRYDcDQ7UH/sKFV0br7AZIgOVT6rYbLvAZeXK9hR V/iTMKTbmTmTjo+2Imff8Xf6kjbpWsQ4IG/M2pJdlybmFLmhOKtLggTi5azWjMURiIcy HDHMjz5MAmQQwA2zla0eiJ3HL6UZJoSTSK3Guk63t2687u1upd83xJ1XI1DBvnkg4Ryp 0WfNeZKU6PP2qdJ9c6+zdTex+V9aGwVL495U/cXXSxsRbM4Q6q31XP0/6wDMqeOjtsVU 96w9uM3yC491QBFlmNPj12nDqz1FE7+RLz3GuCPoAaBhVpWtuvD1fjDRenj0a18Yjvdg Iibw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=aRc2NDXVT0hl+GqEDJOA+TnhB010fZ5nnjfIRwfaqqo=; b=F/YKQJEfNX4ghQsyziPD/+tT4HLGui8VlQcWU3tuyS0/8F2sc9Yqv30SgW208g+LPb ECYwaEN6cfvMBLUCM+uAUlvTruNKJuBgGlemA8jZWviC/FYPMKiNxrsgzv8623b1YEko Q9hLA9dLrYkQdJCdT/qBtb38SG+xBlkWm4cKMHwwBwpQqYIN5Y9FhXvZ71T5zNhpTKPd KkB2Ie8GYPcfq9zcO4wASJ+b82rdIo9/ZE8ahgrCZFBdtUdpC1Y4upo3Fq4I0PB1hN/p LfLkyD0O4ScApEPYM/2MMV5WY6NWqot7DSqmNKXh6/sG9bh/ubBTs3BWJRkETixTFl4x t0Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Nmmaagkv; 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 b22si354353edx.194.2020.06.10.13.29.17; Wed, 10 Jun 2020 13:29:40 -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=Nmmaagkv; 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 S1726871AbgFJU04 (ORCPT + 99 others); Wed, 10 Jun 2020 16:26:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726159AbgFJU04 (ORCPT ); Wed, 10 Jun 2020 16:26:56 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF02CC03E96B for ; Wed, 10 Jun 2020 13:26:55 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id l17so3050669wmj.0 for ; Wed, 10 Jun 2020 13:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=aRc2NDXVT0hl+GqEDJOA+TnhB010fZ5nnjfIRwfaqqo=; b=NmmaagkvhYZf17uZ0pcXtXQVm3uwzfO81dffISFx26jEWPevoNkXv+zMnP45k7V4MV Hfer4PK0gETpDXOJ5CbYYBWh1d/eMVMA5/R4efSYv/INCi0PIbQBbMnOT9om9EGaEgeF c7XmDR6gm8nVGr+KDzXdFNUC+CnA3n+nex4bo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aRc2NDXVT0hl+GqEDJOA+TnhB010fZ5nnjfIRwfaqqo=; b=QhGyD3xXNtj1tGQDz/itGIwAZyxb0LFUOkzJjTAU3z/U63o3GHQLvgZ3tzmPOc3SLi 0xmOGLf2PFgIsMhA5V7wYy0+iijPEz8RnLcXw+q0Tmzo6+cwQXGnGDSv7+tQtz1ab7R9 KJqJPWKGJSmBIyqDbpBt2CQamzKacwxhtmR3WNccylmiNPkAUIzTH0ioQnaMzW6/5Fav vmdGO8lP4CCJGu+vRxasNOlIqR2esCxhwQeYvRbEgK5MQrWAFjBHnaio1N+XkJ2B9l83 NjqUuqIxhz9oY0EzZ+/3MCjmBacOlPgCKsdp9nyLFEUquUpQpDnqeZf6Qu7eQKlE5/1O uV6g== X-Gm-Message-State: AOAM533Y8AOm6uDi6QVk6rY1uBtotitWezLRB3zfR122tFqca6Yvm7YJ NCNKxBwfWIfVK9ZwfM73c/EGBg== X-Received: by 2002:a1c:b182:: with SMTP id a124mr4576408wmf.114.1591820814528; Wed, 10 Jun 2020 13:26:54 -0700 (PDT) Received: from lbrmn-lnxub113.broadcom.net ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id k26sm978085wmi.27.2020.06.10.13.26.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 13:26:53 -0700 (PDT) From: Scott Branden To: Andy Whitcroft , Joe Perches Cc: BCM Kernel Feedback , linux-kernel@vger.kernel.org, Scott Branden Subject: [PATCH] checkpatch: add check for NONNETWORKING_BLOCK_COMMENT_STYLE Date: Wed, 10 Jun 2020 13:26:40 -0700 Message-Id: <20200610202640.9020-1-scott.branden@broadcom.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Scott Branden --- scripts/checkpatch.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 524df88f9364..899e380782c0 100755 --- 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 /* -- 2.17.1