Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1660038pxb; Wed, 2 Feb 2022 09:37:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6beQKm5hvV1o8FO57E+X6xCZBBHEqwBspIYgpd0WhzgSvcfbWr7VcjMVp3tWwyWSy2j4n X-Received: by 2002:a62:d143:: with SMTP id t3mr30401089pfl.52.1643823477605; Wed, 02 Feb 2022 09:37:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643823477; cv=none; d=google.com; s=arc-20160816; b=MWNS086Oq24oeSMraDwRGp4wiptz8CLT/lnTXJUnx5xGZEKrlx+eut9fnslXjCvefU UF5U4XB8p5KgSOTr7fwkqVQjoXo+ZcPyN1yfqa6UpqfNHgkt6xZoSc+QI4mqbgHjcl5I d0FnKketPaFQk3VcBbH9Vc50bCuePFn3Ft3YFIzGN57ej3FW6GYI77MHfozLUO8ecxhs PCA10RB/Eqyj60lUqYowjWpRojBSw2TEhH84zqQLej40u6z/Yp/KbyGJjIYVgowNS58f oI6kyxfvWbv58XAQwUMg+t3zkE200pu+4wczOMNjfgeqM5l0yme1UcCfGXJUsBHmwE5F H31w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=Wx8ROO8op3VTnOEzgAZLt9x0NeCwPv6eupDtuwPaXzw=; b=Xpi3nVYT+W/Anl2QW5LL4jxFHB4ZoHIziUKDCuPuwJLZ4o8tWB8ape62Ea+29BuaSH MIFlu+7Z6sv4VeFgd5xtgQ+rdAdCZgxrvMyVriJYpwuh/4jsVFgTr3W5xvYJsjHNa4/+ eYdM+ejc2NcdIFAzYVDox3HCplYiyRTJ06DuGBRAtkDJKzE9QtQCZ/nU7urN1NjKgqAZ Avty91XmdkiFOSiPpM6/Z+le9MV1ZXceowqHRMSi32xq7iBXrBpI/w5wai04SBwiakL9 VptD5qvN9DalJovF9qIXCdcZbTsC0xrkgcI9miqcvBmEe2vZdrBHEAcPccz7hftAuGCq ctHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=MBjnLFWH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15si7075715pfm.25.2022.02.02.09.37.44; Wed, 02 Feb 2022 09:37:57 -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=pass header.i=@samsung.com header.s=mail20170921 header.b=MBjnLFWH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232212AbiBBKiu (ORCPT + 99 others); Wed, 2 Feb 2022 05:38:50 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:60560 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232066AbiBBKit (ORCPT ); Wed, 2 Feb 2022 05:38:49 -0500 Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20220202103847epoutp046962ccf4dc412a1ea46212d3a8399796~P8d6jGdNt0362403624epoutp04T for ; Wed, 2 Feb 2022 10:38:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20220202103847epoutp046962ccf4dc412a1ea46212d3a8399796~P8d6jGdNt0362403624epoutp04T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1643798327; bh=Wx8ROO8op3VTnOEzgAZLt9x0NeCwPv6eupDtuwPaXzw=; h=From:To:Cc:Subject:Date:References:From; b=MBjnLFWH3munjSxZuHkxDMbCbq6eVYwkIZ7lt6wXMXcNjjI+dcxEyI1rSkd3KShrL cp3otcnStMdY80uFbe2A3F/DfDd3IMim36z3D1Cbicn/1Qy08gM/YR8FZtVkm/0wHy ToIO57c0B/4Ay/jlOYiyTbSRj4e0/T3xec2DZAiU= Received: from epsmges5p3new.samsung.com (unknown [182.195.42.75]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20220202103847epcas5p39d6bcdd378ab9380554fcab835dc2c6e~P8d6IXn_v3184231842epcas5p3K; Wed, 2 Feb 2022 10:38:47 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id F0.36.05590.63F5AF16; Wed, 2 Feb 2022 19:38:47 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20220202103319epcas5p4ed4ae53759fc5c241bc8068132c989d7~P8ZJd7Uef0903109031epcas5p4Y; Wed, 2 Feb 2022 10:33:19 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220202103319epsmtrp1fe2c5a822bf6af3200f6c1fcf624a47f~P8ZJdJ_mH3005430054epsmtrp1B; Wed, 2 Feb 2022 10:33:19 +0000 (GMT) X-AuditID: b6c32a4b-739ff700000015d6-11-61fa5f36fc73 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 1A.A1.08738.FED5AF16; Wed, 2 Feb 2022 19:33:19 +0900 (KST) Received: from localhost.localdomain (unknown [107.109.224.44]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220202103317epsmtip21b11c3fd8241b19a88a71f82c2fab296~P8ZHgBay02377923779epsmtip2o; Wed, 2 Feb 2022 10:33:17 +0000 (GMT) From: Maninder Singh To: apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com, lukas.bulwahn@gmail.com, markus@trippelsdorf.de, akpm@linux-foundation.org Cc: jack@suse.cz, rostedt@goodmis.org, linux-kernel@vger.kernel.org, Maninder Singh , Vaneet Narang Subject: [PATCH v3] scripts/checkpatch.pl: remove _deferred and _deferred_once false warning Date: Wed, 2 Feb 2022 16:03:09 +0530 Message-Id: <20220202103309.1914992-1-maninder1.s@samsung.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMKsWRmVeSWpSXmKPExsWy7bCmpq55/K9Eg/5nTBZz1q9hs/iwVsNi /cJlzBazpzczWcy+/5jF4vKuOWwWLUfbWSwOz29jsfj//zaTxb6OB0wWh07OZXTg9pjV0Mvm sXPWXXaPln232D1OzPjN4vFl1TVmj74tqxg9ziw4wu7Rv+sCk8fnTXIBnFFcNimpOZllqUX6 dglcGc8mdzAWvBKueDK1lb2B8Y1AFyMnh4SAicSMT1eZuhi5OIQEdjNKHF87hxkkISTwiVFi 3/IMiMRnRomLz46zwXS8efOPFSKxi1Fi24lfjBDOF0aJXZMXsoJUsQnoSazatYcFJCEi0Mso MeP1crAWZoHpjBJT5nSzgFQJC8RJvDq5mwnEZhFQlTg1+RpYnFfATuLx8QmMEPvkJWZe+s4O EReUODnzCVgNM1C8eetsZpChEgK9HBKP2nZCHegisWLtaiYIW1ji1fEt7BC2lMTL/jZ2iIZu RokN3cdYIJwZjBKfD16FWmcv8eQiyBMcQCs0Jdbv0ocIy0pMPbWOCWIzn0Tv7ydQC3gldsyD sVUlWm5uYIWwpSU+f/zIAmF7SDTMmsYCCdZYifWftjNOYJSfheShWUgemoWweQEj8yp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xCjNwaIkznuh62S8kEB6YklqdmpqQWoR TJaJg1OqgWmNtbxiXs85gVK3q4rO15/86F7qK76YZabTbxav+05ff51nZ/3wh12m+llkyT7D f57Bf1b4MRyd9yqO6XlMv36a4f0JJkoiIfY2Jzo8F71liFssdvxj4I4bWd3MwWd+flafkdE7 8XT02hC7Ez5R6z87OVxQUeQxllr38+DOWSUN705YCuv6v/57nGHiHp8ttndDzLJeNrc+skku //PVSfRAImP+G/YLbI+ahPMMj3FJyFzYt9k7nWmr06eU5W4v+DNm+XatMlr5QXLbkZ1LWxan uMkEz5S1j0pSYVVs2Ld98ctTL75NXbTh4MP9n5179wo6v9zv9OCmZ+JpJv1Nx7dZL7kswGB9 5Xkh56llUzWVWIozEg21mIuKEwFGx7Rx6gIAAA== X-CMS-MailID: 20220202103319epcas5p4ed4ae53759fc5c241bc8068132c989d7 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P X-CMS-RootMailID: 20220202103319epcas5p4ed4ae53759fc5c241bc8068132c989d7 References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org with commit 98e35f5894cf ("printk: git rid of [sched_delayed] message for printk_deferred") printk_deferred and printk_deferred_once requires LOGLEVEL in argument, but checkpatch.pl was not fixed and still reports it as warning: WARNING: Possible unnecessary KERN_ALERT printk_deferred(KERN_ALERT "checking deferred\n"); As suggested by Andy, made 2 functions from logFunction. 1. logFunction: with all checks 2. logFunctionCore: without printk(?:_ratelimited|_once|_deferred) checking and call logFunctionCore instead of logFunction for checking of loglevel, which will exclude checking of printk(?:_ratelimited|_once|_deferred). This way, there is no need to maintain same stanza at multipe places for removing printk flavours. Co-developed-by: Vaneet Narang Signed-off-by: Vaneet Narang Signed-off-by: Maninder Singh --- v1 -> v2: made 2 functions to remove _deferred and _deferred_once as suggested by Andy Whitcroft. v2-> v3: updated commit message with info of change in printk_deferred. https://lkml.org/lkml/2022/2/2/61 scripts/checkpatch.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b01c36a15d9d..a6fa0c7360be 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -584,8 +584,7 @@ our $typeTypedefs = qr{(?x: our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b}; -our $logFunctions = qr{(?x: - printk(?:_ratelimited|_once|_deferred_once|_deferred|)| +our $logFunctionsCore = qr{(?x: (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)| TP_printk| WARN(?:_RATELIMIT|_ONCE|)| @@ -594,6 +593,11 @@ our $logFunctions = qr{(?x: seq_vprintf|seq_printf|seq_puts )}; +our $logFunctions = qr{(?x: + printk(?:_ratelimited|_once|_deferred_once|_deferred|)| + $logFunctionsCore +)}; + our $allocFunctions = qr{(?x: (?:(?:devm_)? (?:kv|k|v)[czm]alloc(?:_array)?(?:_node)? | @@ -6298,8 +6302,7 @@ sub process { } # check for logging functions with KERN_ - if ($line !~ /printk(?:_ratelimited|_once)?\s*\(/ && - $line =~ /\b$logFunctions\s*\(.*\b(KERN_[A-Z]+)\b/) { + if ($line =~ /\b$logFunctionsCore\s*\(.*\b(KERN_[A-Z]+)\b/) { my $level = $1; if (WARN("UNNECESSARY_KERN_LEVEL", "Possible unnecessary $level\n" . $herecurr) && -- 2.17.1