From nobody Fri Feb 13 09:34:32 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 836A9E7E65D for ; Tue, 26 Sep 2023 19:24:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235692AbjIZTYS (ORCPT ); Tue, 26 Sep 2023 15:24:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235738AbjIZTYO (ORCPT ); Tue, 26 Sep 2023 15:24:14 -0400 Received: from bee.tesarici.cz (bee.tesarici.cz [77.93.223.253]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44CDA180 for ; Tue, 26 Sep 2023 12:24:08 -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 8CEA3181673; Tue, 26 Sep 2023 21:24:06 +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=1695756246; bh=XruJiBHgq+nHTppk3DIZz92BSsLm3t0Pi2qS8t6/ImM=; h=From:To:Cc:Subject:Date:From; b=XQLB8Y3klEtZzr9+TDLL/x32AzWd7ykFiuSofy4z0VCJU+b/r9+4WWJ+2w01VsC5W XyPXB355gORURqgEPW+aMzIkVEwmK5LpFQCgQDzVOKbgXUQxxAJLnPjipFG9SnPdQx tAgMb9Xb1aZ5kE0MSfegv/aJy2i2FnKzemETj/usdg2TfyY0vldwUpUCLiiSmcfMxx MeWeD3RAGmb9tY/UdkgtKCB+S/pNsaytH29cqjRDYxWRdLHYJubZqARx6HJAk5iXc2 /LE6Cg6pg/AUmMpWOcv5uL96piA4+keKQ9mbYMIVytbODjEYWsAHoFOZkEZuMIhTob g0I+slAax448A== 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 v2] checkpatch: warn about multi-line comments without an empty /* line Date: Tue, 26 Sep 2023 21:24:00 +0200 Message-ID: <20230926192400.19366-1-petr@tesarici.cz> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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..e48e7b4d08c0 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 /* Comm= ent...\n" . $hereprev); } =20 +# Non-networking without an initial /* + if ($realfile !~ m@^(drivers/net/|net/)@ && + $prevrawline =3D~ /^\+[ \t]*\/\*.*[^ \t]$/ && + $rawline =3D~ /^\+[ \t]*\*/) { + WARN("BLOCK_COMMENT_STYLE", + "multi-line block comments should start with an empty /* line\n" .= $hereprev); + } + # Block comments use * on subsequent lines if ($prevline =3D~ /$;[ \t]*$/ && #ends in comment $prevrawline =3D~ /^\+.*?\/\*/ && #starting /* --=20 2.42.0