From mboxrd@z Thu Jan 1 00:00:00 1970 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 B9DFAC4167D for ; Fri, 25 Nov 2022 20:17:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229673AbiKYURP convert rfc822-to-8bit (ORCPT ); Fri, 25 Nov 2022 15:17:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbiKYURO (ORCPT ); Fri, 25 Nov 2022 15:17:14 -0500 Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6C8454B1C; Fri, 25 Nov 2022 12:17:12 -0800 (PST) Received: from omf19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A9A43140D5C; Fri, 25 Nov 2022 20:17:10 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA id B5D5220026; Fri, 25 Nov 2022 20:16:38 +0000 (UTC) Message-ID: <39f687f7c71b162eb8caefbec939fa2ad74fcdfc.camel@perches.com> Subject: Re: [PATCH v2 2/3] checkpatch: handle new pr__cont macros From: Joe Perches To: Thomas =?ISO-8859-1?Q?Wei=DFschuh?= , "Rafael J. Wysocki" , Pavel Machek , Len Brown , linux-pm@vger.kernel.org, Petr Mladek , Sergey Senozhatsky , Andy Whitcroft Cc: linux-kernel@vger.kernel.org, Steven Rostedt , Dwaipayan Ray , Lukas Bulwahn Date: Fri, 25 Nov 2022 12:17:05 -0800 In-Reply-To: <20221125190948.2062-3-linux@weissschuh.net> References: <20221125190948.2062-1-linux@weissschuh.net> <20221125190948.2062-3-linux@weissschuh.net> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Stat-Signature: jfghn9hynfghytwr1ikjsr8zhdjio9c7 X-Rspamd-Server: rspamout03 X-Rspamd-Queue-Id: B5D5220026 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+Iblfm+D6CDYgMLfGST2SFn8mRmzUFMYw= X-HE-Tag: 1669407398-853785 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Fri, 2022-11-25 at 20:09 +0100, Thomas Weißschuh wrote: > These new macros from include/linux/printk.h replace the usage of plain > pr_cont(). [] > 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|)| OK > 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); > } OK > +# check for logging continuations without explicit level > + if ($line =~ /\bpr_cont\s*\(/) { > + WARN("LOGGING_CONTINUATION_WITHOUT_LEVEL", > + "Avoid logging continuation without level\n" . $herecurr); > + } > + Not so sure about this one. I think relatively few situations are going to require interleaving avoidance. > # check for unnecessary use of %h[xudi] and %hh[xudi] in logging functions > if (defined $stat && > $line =~ /\b$logFunctions\s*\(/ &&