The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Yu Zhe <yuzhe@nfschina.com>,
	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
Subject: Re: [PATCH] sched: change printk(KERN_<LEVEL>.. to pr_<level>()
Date: Thu, 26 May 2022 02:42:35 -0700	[thread overview]
Message-ID: <c6ef4c847aecbe12cc2bd71509c0359aade18fcc.camel@perches.com> (raw)
In-Reply-To: <20220526091031.3741819-1-yuzhe@nfschina.com>

On Thu, 2022-05-26 at 02:10 -0700, Yu Zhe wrote:
> Prefer pr_<level>(...  to printk(KERN_<LEVEL> ..., 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.



  reply	other threads:[~2022-05-26  9:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26  9:10 [PATCH] sched: change printk(KERN_<LEVEL>.. to pr_<level>() Yu Zhe
2022-05-26  9:42 ` Joe Perches [this message]
2022-05-27  6:10 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6ef4c847aecbe12cc2bd71509c0359aade18fcc.camel@perches.com \
    --to=joe@perches.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liqiong@nfschina.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yuzhe@nfschina.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox