From: Peter Zijlstra <peterz@infradead.org>
To: luoliang@kylinos.cn
Cc: Ingo Molnar <mingo@redhat.com>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Valentin Schneider <vschneid@redhat.com>,
K Prateek Nayak <kprateek.nayak@amd.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/core: Combine separate 'else' and 'if' statements
Date: Mon, 8 Jun 2026 10:08:46 +0200 [thread overview]
Message-ID: <20260608080846.GB3102624@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20260608071842.325159-1-luoliang@kylinos.cn>
On Mon, Jun 08, 2026 at 03:18:42PM +0800, luoliang@kylinos.cn wrote:
> From: Liang Luo <luoliang@kylinos.cn>
>
> The kernel coding style recommends using 'else if' instead of
> placing 'if' on a separate line after 'else'. This change makes
> the code consistent with the rest of the kernel codebase.
Right, this is because the things used to be inside #ifdef CONFIG_SMP.
I did notice it a few times, but I generally don't bother with
trivialities like this until the code needs touching for other reasons.
But I suppose since you took the effort, I might as well apply this. But
please don't go whitespace fixing the scheduler code.
> Signed-off-by: Liang Luo <luoliang@kylinos.cn>
> ---
> kernel/sched/core.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index da20fb6ea25a..c2bf0fc6ac97 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3716,8 +3716,7 @@ ttwu_do_activate(struct rq *rq, struct task_struct *p, int wake_flags,
> en_flags |= ENQUEUE_RQ_SELECTED;
> if (wake_flags & WF_MIGRATED)
> en_flags |= ENQUEUE_MIGRATED;
> - else
> - if (p->in_iowait) {
> + else if (p->in_iowait) {
> delayacct_blkio_end(p);
> atomic_dec(&task_rq(p)->nr_iowait);
> }
> --
> 2.45.0
next prev parent reply other threads:[~2026-06-08 8:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 7:18 luoliang
2026-06-08 8:08 ` Peter Zijlstra [this message]
2026-06-09 8:32 ` [tip: sched/core] " tip-bot2 for Liang Luo
-- strict thread matches above, loose matches on Subject: below --
2026-05-13 8:54 [PATCH] " luoliang
2026-05-15 16:24 ` Valentin Schneider
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=20260608080846.GB3102624@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luoliang@kylinos.cn \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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
all inboxes | Powered by JetHome®