From patchwork Fri Nov 25 19:09:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 26123 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4238160wrr; Fri, 25 Nov 2022 11:11:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf5d0LZOX1aBccpArVG09sgOiVOZnpvxpTR09FTwt8WuLAzEuI+ulul4cOUFJQD7usZ8PFCp X-Received: by 2002:a17:903:3252:b0:189:637e:1d6b with SMTP id ji18-20020a170903325200b00189637e1d6bmr6120626plb.3.1669403516865; Fri, 25 Nov 2022 11:11:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669403516; cv=none; d=google.com; s=arc-20160816; b=anVal8SvjDZ9QJa0yAOkzlzu76iqxsQlnFBa+qOIhukeUs4eeKeIn+v1Sh3h/9S9Fp E9lyBWBAkICzUsD1SQHk6ZjDJ9j98/Iw8bo2abdRQzCWU9IewHKR5Xa1tvWL075Dt2Vq hVH67fyZ2iSfYjNcPpc2QUSwTvNPTk3GnsqUbtc5SS6yM6FOWdCXZ/hkLreyBDcUbHIv sY+0wR1wlJdHF6XjBitAGyAQ/EeSAECSkfVhX1HPEzOE8x5OSpmMLRFdneG6sllRhFSF ipbZDK+S/qYrAMYCVRrkvIZASY6OM4SHi70kjH+QWeQzTDJ+fo8CxvAk35Tvg9UqBMKZ zYng== 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 :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :from; bh=85+RmbP97i1+7i5FKOCtxkUDq2tDIH0zYx/d4ZFuaUI=; b=ieXSLdk+VGjMUwJWKNalQEpSZQeQGkD+6koFN0ycTKtxeOH+vMDtiYDrb799m68gvp Zr8W0ud6JJlyljK0WOLNyxdFoAzDZag4l3AJFAjrt1WxnfS6Zmao//F2+EmzL1HdJagV LmKhCXMJkq8cKBEApPXxMFzbOLIk2MSc46Kq4DPQZABiVRG0EB1LgKOxDVgavndHcJ6w 7YLHlCU987laJNOtLW60I0j3TeB3u24G4Z03QvCMkvB5xwcWtNkdr2YIG9c4INbhU1zW mr/ppWzvYfWb7i3WBq9oN5Zvzb+X6RjLqTdC32YuBaUh9OI+Q/6ym7ed0fodFJ4kRY9v 1f1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=CNXSiJN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n18-20020a63f812000000b00476c6b9cf69si4717884pgh.856.2022.11.25.11.11.44; Fri, 25 Nov 2022 11:11:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=CNXSiJN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbiKYTKV (ORCPT + 99 others); Fri, 25 Nov 2022 14:10:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiKYTKP (ORCPT ); Fri, 25 Nov 2022 14:10:15 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E21AA5474F; Fri, 25 Nov 2022 11:10:12 -0800 (PST) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1669403409; bh=Cc2ClTVm2l8saukQMqFH86xff8jJ/Zkmp6yCVTzmAQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CNXSiJN+v/zXwLWrJgqlJGajJyPZ+7jU7x3u9+ts6auIIMHQWL5v/ZFxECTf3QJxf zUzvLrNg/oI6Y8MFxCFjNNUIA0f2vVUe3HV1ZF3wsuC5TbBcJfacROfdIgv6thy+rX tjIWAjg8dDcQm8M7EkhL7B9Fh3bFhr83UEe3LuDY= To: "Rafael J. Wysocki" , Pavel Machek , Len Brown , linux-pm@vger.kernel.org, Petr Mladek , Sergey Senozhatsky , Andy Whitcroft , Joe Perches Cc: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , linux-kernel@vger.kernel.org, Steven Rostedt , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH v2 2/3] checkpatch: handle new pr__cont macros Date: Fri, 25 Nov 2022 20:09:47 +0100 Message-Id: <20221125190948.2062-3-linux@weissschuh.net> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221125190948.2062-1-linux@weissschuh.net> References: <20221125190948.2062-1-linux@weissschuh.net> MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1669403373; l=1632; i=linux@weissschuh.net; s=20211113; h=from:subject; bh=Cc2ClTVm2l8saukQMqFH86xff8jJ/Zkmp6yCVTzmAQI=; b=Uv1SmRxhkAlXNeJpl8GBYcYw6GTCbSPRtF1w2m1VcrJcH7C7QOYyiOMZrST2deFGQxKEXv9JWLkg m0rSB25MBJRBtXF+hi+Jg+AwA7gpFO20zxvfQkexKukujd4f9lHt X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=9LP6KM4vD/8CwHW7nouRBhWLyQLcK1MkP6aTZbzUlj4= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750496462047832953?= X-GMAIL-MSGID: =?utf-8?q?1750496462047832953?= These new macros from include/linux/printk.h replace the usage of plain pr_cont(). Signed-off-by: Thomas Weißschuh --- scripts/checkpatch.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1e5e66ae5a52..fb1747639c9c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -590,7 +590,7 @@ our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b}; our $logFunctions = qr{(?x: printk(?:_ratelimited|_once|_deferred_once|_deferred|)| - (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)| + (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|_cont|)| TP_printk| WARN(?:_RATELIMIT|_ONCE|)| panic| @@ -6374,11 +6374,17 @@ sub process { } # check for logging continuations - if ($line =~ /\bprintk\s*\(\s*KERN_CONT\b|\bpr_cont\s*\(/) { + if ($line =~ /\bprintk\s*\(\s*KERN_CONT\b|\bpr_([a-z]+_)?cont\s*\(/) { WARN("LOGGING_CONTINUATION", "Avoid logging continuation uses where feasible\n" . $herecurr); } +# check for logging continuations without explicit level + if ($line =~ /\bpr_cont\s*\(/) { + WARN("LOGGING_CONTINUATION_WITHOUT_LEVEL", + "Avoid logging continuation without level\n" . $herecurr); + } + # check for unnecessary use of %h[xudi] and %hh[xudi] in logging functions if (defined $stat && $line =~ /\b$logFunctions\s*\(/ &&