Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2231200rdh; Tue, 26 Sep 2023 17:33:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IElOzQPrHIcok/Z6Jt9XgpL3txWmmiow7klTorJLWWFO/XN79A4fiO93Q/YxbilNsG7+FxM X-Received: by 2002:a17:902:d4c3:b0:1c5:6309:e1e2 with SMTP id o3-20020a170902d4c300b001c56309e1e2mr485798plg.48.1695774798073; Tue, 26 Sep 2023 17:33:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695774798; cv=none; d=google.com; s=arc-20160816; b=mq0L3hTtjHUgmF6z2aPTaZNNt61LzxWm+Rqbldk57yonV5n3veaEKbdqOFw/sGUmMv q72uRFMK+JzQxDQx9igLbpoW7jqbnqrlHAyaKhJYgqeXq6PG/dTVzPxLzY3/aRA5TUqB M908ZXsEXQ4CpLBtVsyrs3iKmK5pMDhsTa1EhhjftQlpak0dHCqNon78HRWaqDzrd0Z5 tTeHK79D/2JWHlTgmxifFdfgAp5XFM4gSL+31NQC6GN6dzS1u1hARxaHYGf2d+3feRNk XIAffbrw0BQNcKU8lEsnojCg3JcoBFNb76Dtvtu2U2Ni/8EtkSdh55g0If5Mo3zH8R6Y +G3w== 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=wN0W47RTDOU1Yq1+TeE4qrYFkVwmz5gMq/wd9D9Sc94=; fh=oevolkDE1K0CeTYR3D1eCklAdNWfou4M43LL7npywNg=; b=uuBSDCC5yyXKJEvOli6nViGqbug696e6KRGZoJDbTatElqKslTVuwVHHbZWW0KzTAi Y2ZD1d3YZV4lBa2d+JX41c/AKRsynkoQwBGsqZpvTZFkjBfjI+kUdzULkfOJI/PYXbVq beeUQ4uSKnJwbfbmnynxS6440dNf9etm9lD7xjbo3An3FW+iXWBlygDukgSMQSpUOdJa 0WMhu4wUnQxc4QP94rA6wpr1gJs/G4eWKDSqljQGyjMNTH8KFlGsb/HmwQCfQonaVEKb /bjQELGRxyTkxhQD3082Mku5Q5+soGb15Tkdzv8cxDDEtmIGYEGXB8kfI8rV9L3koDlR DvzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=XQLB8Y3k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id d10-20020a170902654a00b001b8af83d939si13740509pln.537.2023.09.26.17.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 17:33:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@tesarici.cz header.s=mail header.b=XQLB8Y3k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id EDC2F832C9D8; Tue, 26 Sep 2023 12:24:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230259AbjIZTYR (ORCPT + 99 others); Tue, 26 Sep 2023 15:24:17 -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: 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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 26 Sep 2023 12:24:16 -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..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 /* Comment...\n" . $hereprev); } +# Non-networking without an initial /* + if ($realfile !~ m@^(drivers/net/|net/)@ && + $prevrawline =~ /^\+[ \t]*\/\*.*[^ \t]$/ && + $rawline =~ /^\+[ \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 =~ /$;[ \t]*$/ && #ends in comment $prevrawline =~ /^\+.*?\/\*/ && #starting /* -- 2.42.0