From: Markus Elfring <Markus.Elfring@web.de>
To: kernel-janitors@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] sched/topology: One function call less in build_group_from_child_sched_domain()
Date: Sat, 6 Jul 2019 16:05:17 +0200 [thread overview]
Message-ID: <ad2e7dfb-3323-b214-716e-a6cae41b8bcc@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 6 Jul 2019 16:00:13 +0200
Avoid an extra function call by using a ternary operator instead of
a conditional statement.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
kernel/sched/topology.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index f751ce0b783e..6190eb52c30a 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -886,11 +886,7 @@ build_group_from_child_sched_domain(struct sched_domain *sd, int cpu)
return NULL;
sg_span = sched_group_span(sg);
- if (sd->child)
- cpumask_copy(sg_span, sched_domain_span(sd->child));
- else
- cpumask_copy(sg_span, sched_domain_span(sd));
-
+ cpumask_copy(sg_span, sched_domain_span(sd->child ? sd->child : sd));
atomic_inc(&sg->ref);
return sg;
}
--
2.22.0
next reply other threads:[~2019-07-06 14:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-06 14:05 Markus Elfring [this message]
2019-07-06 17:22 ` Srikar Dronamraju
2019-07-08 9:38 ` Enrico Weigelt, metux IT consult
2019-07-08 14:27 ` Srikar Dronamraju
2019-07-08 10:23 ` Peter Zijlstra
2019-07-08 14:07 ` Srikar Dronamraju
2019-07-08 15:44 ` Markus Elfring
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=ad2e7dfb-3323-b214-716e-a6cae41b8bcc@web.de \
--to=markus.elfring@web.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/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®