Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp11213046rwb; Fri, 25 Nov 2022 12:32:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf4+WpP7yDABiUxBlw4Oew5rkTu4ECvYSTjOVCuwFN7R7Uw5vUdQa6663DfsVJBrjoedOUs/ X-Received: by 2002:a17:90b:35c8:b0:20a:78b7:9210 with SMTP id nb8-20020a17090b35c800b0020a78b79210mr41516353pjb.138.1669408337873; Fri, 25 Nov 2022 12:32:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669408337; cv=none; d=google.com; s=arc-20160816; b=C+e8bhqN9SRTnR+o2OH5j7Qv7zBt8jeCKzOi5h+B/y/uTDivjGOXlRsbSMnsI+H2pB kGBtsKmlQ+BOWq+RxlBqN72+rm3d6eZoyE0g092XIkkzo161Qk57IPZMHZmk/shNqFn0 vs/7En6TsfYhXM6Iy3VenfSfKq/pFYzKQnARrq2WPHcu8ObxHnd7hy4hx8Bpitz23+PL Tc6Fsjgbfg7Dqi1FEGx15hNdJFr+ZcYgXJ35HBbDlbP4SbmiOvmLeE6vlVDkiPeUcaMG M/W4Pofey83W1w54rbw+Vk6kxUWUaubf5kB48ymaOGMBT+lz9yosNfI6c9eRHjO34azS vIfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=DD+LwOoa0ZH8kFyuGrY0G39J11TygOAuBm9PTc93dGM=; b=sBsBP1RQ3T/1dtQScQGHgaQn2NrgpsJC2Ud9WuTOztFmgVN8wCY8BeSxGSu7UZxoQf +eh+HJGBPhUpFF+5ndgVNqQHTond2hX0mdKbEczaF3O985ykpBfBe5w2Dt6TVFlDsWok Q2cCqCwsEHt8l30ci/PZcjjhKWfTc4lu70NS6/Tl3oyZ5Rxz1I8Uk6dEDREKVvPJIJ// qjCHJjaqgZIK9UaFAxHHFNmXzE1nTqP/O0oV8i+3XyK4/5+UjncAxrZyZhegKWYfhxwi Vk6ocaDAa8IOmSFpmkDMqdqcxTYaR3tPzYEsL4WY2fVynbu5nYr2GYCFb3qutpId6XqW YSbA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u3-20020a17090aae8300b00212eb5485afsi4452354pjq.77.2022.11.25.12.32.06; Fri, 25 Nov 2022 12:32:17 -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; 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 S229787AbiKYURQ convert rfc822-to-8bit (ORCPT + 85 others); Fri, 25 Nov 2022 15:17:16 -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-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, KHOP_HELO_FCRDNS,SPF_HELO_PASS,SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+Iblfm+D6CDYgMLfGST2SFn8mRmzUFMYw= X-HE-Tag: 1669407398-853785 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 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*\(/ &&