Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2260352rdh; Tue, 26 Sep 2023 18:50:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTgx0yODNbN0vunwrr1eG8+14IFTvklTs4cjze+W3oycEtVVAuNjdSbQRQDT3HsXiaqNAY X-Received: by 2002:a05:6358:89b:b0:143:8eb4:cf36 with SMTP id m27-20020a056358089b00b001438eb4cf36mr753379rwj.5.1695779403101; Tue, 26 Sep 2023 18:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695779403; cv=none; d=google.com; s=arc-20160816; b=iBb1bmEBho8cQmX4PeQmnMIB8kFSpWB+GfDIw+jSbj+mnYJgUV7leoti5OSPzrkCXC mFJtq557bqQXYDycTXc8GWrDm4ucQVZigSxbALH7V2B7I8ADVEKxltMS2UpFfoGOvBLJ E6ezYQoraGDTAuoyI3Ic5GlquZ+i08J1+NyCbSgPojqlDurh0xdrK9kxl1jgC7kBzFX8 lx7vygp7IHkO6SpuzcyT/zzP4ebs3BWRjV3M94RQfbt8Nwo8CqZADQcsBi0TBQrsAoZM 9+F6DWpTJLQumByeHkhPrnX18ANbQctmZmWsHGbe/gLj7hsIvyo+EAlMNDRy0ID6p9Z0 3Png== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Q6c9ebNA+fcaHBQf7EIzoROhWDCr2pbmqMXOd3+4fjg=; fh=oevolkDE1K0CeTYR3D1eCklAdNWfou4M43LL7npywNg=; b=eeuCIVbkPbIugbdUD7N9kiWJa4lkfyWVPcdPMqe9tjLTuV66O/fJE8hdaLLN8SYVw3 tASJuwBBv/7TF6Nqe1bmV/Hq6OALeGx8MwoYvvXnHjVLvMmFShPh78JwS0pEC4/yccaK H4wfG2zBObqJtBUmN94VulwArwR9ADz+q3DWrgw6CCA9uz9Wc47YnL9gArRQROG1MTur doCV9hM+l2TuHj4m10dCfKj3mhTF2SFKiM8mt87hRFfRAIT8F5h9B4BuLQTzUTVpotYL zz0k7m6d93x/GubF7GmGubM5R7I12pzTGgOCVTWne0A4YkGpu4Ff212HHVvDIBJ5gSK6 8wcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=jwZySkMf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tesarici.cz Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id k189-20020a6384c6000000b0057761dd9c56si14028898pgd.322.2023.09.26.18.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 18:50:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=jwZySkMf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tesarici.cz Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7E3BC80CBF11; Tue, 26 Sep 2023 12:20:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231273AbjIZTUX (ORCPT + 99 others); Tue, 26 Sep 2023 15:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbjIZTUW (ORCPT ); Tue, 26 Sep 2023 15:20:22 -0400 Received: from bee.tesarici.cz (bee.tesarici.cz [IPv6:2a03:3b40:fe:2d4::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C908E92 for ; Tue, 26 Sep 2023 12:20:15 -0700 (PDT) Received: from meshulam.tesarici.cz (dynamic-2a00-1028-83b8-1e7a-4427-cc85-6706-c595.ipv6.o2.cz [IPv6:2a00:1028:83b8:1e7a:4427:cc85:6706:c595]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bee.tesarici.cz (Postfix) with ESMTPSA id 52CBC180BFA; Tue, 26 Sep 2023 21:20:13 +0200 (CEST) Authentication-Results: mail.tesarici.cz; dmarc=fail (p=none dis=none) header.from=tesarici.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tesarici.cz; s=mail; t=1695756013; bh=QmHO9guWcCdGsga/mvVCpATrxgl+h8uqruAwQ/x5zz0=; h=From:To:Cc:Subject:Date:From; b=jwZySkMf1YnyvpaKRAfRHZYU0aa0zIFhZiChoRv/2j8VSSGYbpSxRA7GgwQYtbtet GSM4IpPJWuNFjJyRf12RisgrRGZyZKHesQZgUBcv0IHS2+VTBiWq4zw8L+b8zpAVMt kZp10Gj01ovcNEjuKBXAPfr9XHdWKFMIrrvW89otdA3HXv+r6dY892VOaHv1wqcVLD EMU6UEBTxxLN7iusEMi6YnLynJRNd/MW0rBeROTVMCMF5AJHIA70Vmsqg/C1IVD+fg zWeN7CCKjkgmvce34CNs6/ettzrCKppcSoyKi347e0O+Roc+eKmH7P+dFCPZHyCpfy ErXfZqz2lrEdQ== From: Petr Tesarik To: Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , linux-kernel@vger.kernel.org (open list) Cc: Catalin Marinas , Petr Tesarik Subject: [PATCH] checkpatch: warn about multi-line comments without an empty /* line Date: Tue, 26 Sep 2023 21:20:06 +0200 Message-ID: <20230926192006.18351-1-petr@tesarici.cz> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 26 Sep 2023 12:20:21 -0700 (PDT) According to Documentation/process/coding-style.rst, the preferred style for multi-line comments outside net/ and drivers/net/ is: .. code-block:: c /* * This is the preferred style for multi-line * comments in the Linux kernel source code. * Please use it consistently. * * Description: A column of asterisks on the left side, * with beginning and ending almost-blank lines. */ Signed-off-by: Petr Tesarik --- scripts/checkpatch.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7d16f863edf1..0fc3427a9ec9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4006,6 +4006,14 @@ sub process { "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev); } +# Non-networking without an initial /* + if ($realfile !~ m@^(drivers/net/|net/)@ && + $prevrawline =~ /^\+[ \t]*\/\*.*[^ \t]$/ && + $rawline =~ /^\+[ \t]*\*/) { + WARN("MULTILINE_BLOCK_COMMENT_STYLE", + "multi-line block comments should start with an empty /* line\n" . $hereprev); + } + # Block comments use * on subsequent lines if ($prevline =~ /$;[ \t]*$/ && #ends in comment $prevrawline =~ /^\+.*?\/\*/ && #starting /* -- 2.42.0