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 6CA99C433F5 for ; Thu, 26 May 2022 09:42:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346877AbiEZJmn (ORCPT ); Thu, 26 May 2022 05:42:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234213AbiEZJml (ORCPT ); Thu, 26 May 2022 05:42:41 -0400 Received: from relay3.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 792AFC8BDD for ; Thu, 26 May 2022 02:42:40 -0700 (PDT) Received: from omf07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B976720544; Thu, 26 May 2022 09:42:38 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf07.hostedemail.com (Postfix) with ESMTPA id 021252003D; Thu, 26 May 2022 09:42:35 +0000 (UTC) Message-ID: Subject: Re: [PATCH] sched: change printk(KERN_.. to pr_() From: Joe Perches To: Yu Zhe , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, liqiong@nfschina.com Date: Thu, 26 May 2022 02:42:35 -0700 In-Reply-To: <20220526091031.3741819-1-yuzhe@nfschina.com> References: <20220526091031.3741819-1-yuzhe@nfschina.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4-1ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Stat-Signature: 4uf7udqbm87wddzbw3h8mwznh4j9xm41 X-Rspamd-Server: rspamout02 X-Rspamd-Queue-Id: 021252003D X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19/TJyW95qAsdXhHiBoregiLp5IybD9cZ8= X-HE-Tag: 1653558155-406124 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2022-05-26 at 02:10 -0700, Yu Zhe wrote: > Prefer pr_(... to printk(KERN_ ..., change them. Do remember that checkpatch is just a guide and isn't always correct. You are responsible for verifying that anything it suggests is converted properly. > diff --git a/kernel/sched/core.c b/kernel/sched/core.c [] > @@ -9370,7 +9370,7 @@ static void dump_rq_tasks(struct rq *rq, const char *loglvl) > > lockdep_assert_rq_held(rq); > > - printk("%sCPU%d enqueued tasks (%u total):\n", loglvl, cpu, rq->nr_running); > + pr_warn("%sCPU%d enqueued tasks (%u total):\n", loglvl, cpu, rq->nr_running); This is _not_ a good change. Do please look to see what loglvl is and if this change is appropriate. > for_each_process_thread(g, p) { > if (task_cpu(p) != cpu) > continue; > @@ -9378,7 +9378,7 @@ static void dump_rq_tasks(struct rq *rq, const char *loglvl) > if (!task_on_rq_queued(p)) > continue; > > - printk("%s\tpid: %d, name: %s\n", loglvl, p->pid, p->comm); > + pr_warn("%s\tpid: %d, name: %s\n", loglvl, p->pid, p->comm); here too.