Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3498850imb; Tue, 5 Mar 2019 10:53:22 -0800 (PST) X-Google-Smtp-Source: APXvYqyoFRnWRfUCOIIyRASjmzxwIq0ATTy3iz5TVK+1iGn+CZO3smvgpk3cnkng7hssZ9TJcyUi X-Received: by 2002:a17:902:d702:: with SMTP id w2mr2744217ply.131.1551812002616; Tue, 05 Mar 2019 10:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551812002; cv=none; d=google.com; s=arc-20160816; b=Zjm3ya32PNomT0swI7Zqewa/QvDDsgXCzMsBZBK2ACe3Yh6o3KZV7/a3tl9/cW+MXe mmVtBEa6JquxegniX0yMFlfa6LC8t8DrsgHYboZXz0q6UFnHtXfmv0tNTZb4yn0vGzd3 ULxtMiUeDYcZWbnnuZpAOoaDqhF8fJIYfS5Cxpsw6CxS55OfPhh5yIl4BqcAs6y/OoZF DX1qJVdRG7hSMUFT4YUc/F9pUfCFp+HXT+WDAXJgy53jTXjmbCkhqxOU6gapDmk5MIwo sKzrDnpydI2QxhGgKCFh5Z85TxhSJmWAJRIku9O2HdUroFP3iulsPTz6L1ON+9uEKdf8 UXcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=eHzzZHYqiHNBGTspimXYHzjn5pNpxbyrfXcH/XTQvB4=; b=dtlUJFEflBMkhBb0YqXSIJzDDX1Ks5+blPZQNdN1sBFdwPO8w5kFRRwo1fzVjytIsA vNATuUVt6nhNdaKCQZEcBVXXsB7jcCDYA+AS097rsCRewgRcd9zbMtH7sY5MZQWL3ygR qR7xVsCcrT8Svgoc8AIDOtX47Oiwytab3QkB0JLhMGdbZdSkfJlL1j9xh+SZV4+RMsiQ SiUcC8Hexicej9Kv1fMheaBrRZPN4/ZhX5YT2pqGmHkWE9/QMqOZx9OgXngXHqLOfYec cHpjH0b0tVQlt/9u87SbsBZatk5W/hQMzJ/yl27pdfxKtLv1Nnko3pBj8PyNWq1Q2zbL rjeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8si8604599pls.365.2019.03.05.10.53.07; Tue, 05 Mar 2019 10:53:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728537AbfCESCo (ORCPT + 99 others); Tue, 5 Mar 2019 13:02:44 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:42381 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726535AbfCESCo (ORCPT ); Tue, 5 Mar 2019 13:02:44 -0500 Received: from alex.numericable.fr (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 3D34510000E; Tue, 5 Mar 2019 18:02:41 +0000 (UTC) From: Alexandre Ghiti To: Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org Cc: Alexandre Ghiti Subject: [PATCH] scripts: checkpatch: Check block comments start with /* empty line outside net Date: Tue, 5 Mar 2019 13:02:38 -0500 Message-Id: <20190305180238.32630-1-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch ensures that apart from net code, block comments start with an empty /* line. Signed-off-by: Alexandre Ghiti --- scripts/checkpatch.pl | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7dc12c137009..bcaf5d317976 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3230,12 +3230,21 @@ sub process { # Block comment styles # Networking with an initial /* - if ($realfile =~ m@^(drivers/net/|net/)@ && - $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ && - $rawline =~ /^\+[ \t]*\*/ && - $realline > 2) { - WARN("NETWORKING_BLOCK_COMMENT_STYLE", - "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev); + if ($realfile =~ m@^(drivers/net/|net/)@) { + if ($prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ && + $rawline =~ /^\+[ \t]*\*/ && + $realline > 2) { + WARN("NETWORKING_BLOCK_COMMENT_STYLE", + "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev); + } + } else { +# 'Normal' with an initial empty /* + if ($prevrawline =~ /^\+[ \t]*\/\*[ \t]*\S/ && + $rawline =~ /^\+[ \t]*\*/ && + $realline > 2) { + WARN("BLOCK_COMMENT_STYLE", + "block comments use an empty /* line, don't use /* Comment...\n" . $hereprev); + } } # Block comments use * on subsequent lines -- 2.20.1