Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1047130ybg; Wed, 10 Jun 2020 22:41:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/M9fzGWs+xvNTQEd0T95+HhBvaE8zqElITs7HlBZbyx4khVB5K3/fomh2SlhM/lPDQs+k X-Received: by 2002:a17:906:c452:: with SMTP id ck18mr7155021ejb.116.1591854104360; Wed, 10 Jun 2020 22:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591854104; cv=none; d=google.com; s=arc-20160816; b=C4x4iQYKAGeMtma4EGQwTY/92tUENFxVO7gzVsDwDi0CQ+v7UKFYyzlzUPGLy7atJl oFrWOCn2POmixDM6AYc+MxJR8qaguNiju3zdze9sNIiHU71dnmwQEbxCw7h79AvZNuvu SvMM7iMv5Oo3Q8iYQ2eBwJ3TksvRpBi2C1fCmWCmcfKKS7YJFmK80LOzgltcg7WPRpZt 3IvSb9b3MPe0+gZri+QOwpZ/pfBSx4nt3aEv/kO4ainJ8a3W50GCNXG64zDc4zyedQ+7 zq0cc2y7nDRQLY5FT9rLaVCnXuBEuGS72KI1gxBRICPKB0tq8BWbUDX7RXo6rFR6nQPm napg== 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=tF510AlbcUE6tq4ktArBowJC1gEM9p0c32UAoE8MTdA=; b=IcfVES8Po6zm/T7+I+++3XXDyKMpkkvqpG8kKrywz1exuYQzE8ms7S2XxVWCmyhr7x /I8aj0NFoLZbOm4rviFh6NlCCZCfuFpXAvC7w1M1kAZZjxb87A8Q2eMm5r4eP1FQC3Dm qOBgxWF/9lo1MM4L4ANeg8wacTxDCo4faoV/Y/H9+2MNOq/dyIjQoLcfrI7yLwwkRCU1 WzIO43OdWIPhNVThU3wjEeb3Fm3r+WWyKtVCXEw1/8Oc5iKu6dVkBmbELasbREgSHN4O IZl2/YcsXJ1ra5zQ3EIKRngrm2bqSoSXTp/pwK79Io5wG6cLL69k/x5F7CATt4GicSd8 7GaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=cCQPH702; 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 wn19si1423719ejb.524.2020.06.10.22.41.21; Wed, 10 Jun 2020 22:41:44 -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=cCQPH702; 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 S1726417AbgFKFhe (ORCPT + 99 others); Thu, 11 Jun 2020 01:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725300AbgFKFhd (ORCPT ); Thu, 11 Jun 2020 01:37:33 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5373DC08C5C1 for ; Wed, 10 Jun 2020 22:37:33 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id d128so3781383wmc.1 for ; Wed, 10 Jun 2020 22:37:33 -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=tF510AlbcUE6tq4ktArBowJC1gEM9p0c32UAoE8MTdA=; b=cCQPH702LQIzMamek2cP15P+xs8XaUgSnbWJuJiP34/yrGctLlcDNvbJIQojKNXaAP MtTXsW+/EObHkfcAbqNzUI1Dmekyz4aEQQ4zVTg7tHSSAHndZOXMmlgeJ/u9thA+aOIN eK2C5FaHwv3kWtRoM93JGPdhApyKLjw2Sp9qo= 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=tF510AlbcUE6tq4ktArBowJC1gEM9p0c32UAoE8MTdA=; b=OIPXqjj4UknmDmL2g162KVcVXMH6gDGuWKEPrU0TLEQMcRHJom3txzK2tvkEafpHhn VRF6rBdDgKA+52c4Acejyx8aBb+9LYB23kKqcTAT6mmDhpZwzmQ8mX8grGZ9XWtnAITx wETbAeGcTLY6SmJE53fQIaYNa5EvHtxXZP4ici4ED7vtUy3u89HiakHecu+uGLSWu1pj C87vbffHoVsPPAVbnuI5zL/97WWFPm30JxTGTTKBd3UkPzN6k7emEeGjFmANQDEGOJS2 H6ood+0oIh1Edo31p5luzYyBJmPfPhqq1wdlZoiiQx/HVuHaz4ioHgOKzjNwarZP4sVX 2Z1w== X-Gm-Message-State: AOAM530ZgLlWTLXdad50BvmuIxl4F3RLvCH+1PLVFc7FQh5HMeO2ggtL Bflej+9k7nfCVvreAWorUp5LdA== X-Received: by 2002:a1c:6a1a:: with SMTP id f26mr6510830wmc.80.1591853851364; Wed, 10 Jun 2020 22:37:31 -0700 (PDT) Received: from lbrmn-lnxub113.broadcom.net ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id 50sm3328214wra.1.2020.06.10.22.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 22:37:30 -0700 (PDT) From: Scott Branden To: Andy Whitcroft , Joe Perches Cc: BCM Kernel Feedback , linux-kernel@vger.kernel.org, Scott Branden Subject: [PATCH v2 1/1] checkpatch: add check for NONNETWORKING_BLOCK_COMMENT_STYLE Date: Wed, 10 Jun 2020 22:37:19 -0700 Message-Id: <20200611053719.17092-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 --- Changes since v1: ----------------- Do file/patch test and used CHK on file as suggested by Joe Perches. --- scripts/checkpatch.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d4860972c721..45c71e7543f7 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3408,6 +3408,18 @@ 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) { + my $msg_level = \&WARN; + $msg_level = \&CHK if ($file); + &{$msg_level}("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