mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Wang Wensheng" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Wang Wensheng <wangwensheng4@huawei.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/core] tick: Use tick_check_replacement() instead of open coding it
Date: Fri, 16 Apr 2021 19:07:56 -0000	[thread overview]
Message-ID: <161860007631.29796.743363594563784489.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20210326022328.3266-1-wangwensheng4@huawei.com>

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     d7840aaadd6e84915866a8f0dab586f6107dadf1
Gitweb:        https://git.kernel.org/tip/d7840aaadd6e84915866a8f0dab586f6107dadf1
Author:        Wang Wensheng <wangwensheng4@huawei.com>
AuthorDate:    Fri, 26 Mar 2021 02:23:28 
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 16 Apr 2021 21:03:50 +02:00

tick: Use tick_check_replacement() instead of open coding it

The function tick_check_replacement() is the combination of
tick_check_percpu() and tick_check_preferred(), but tick_check_new_device()
has the same logic open coded.

Use the helper to simplify the code.

[ tglx: Massage changelog ]

Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210326022328.3266-1-wangwensheng4@huawei.com

---
 kernel/time/tick-common.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 9d3a225..e15bc0e 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -348,12 +348,7 @@ void tick_check_new_device(struct clock_event_device *newdev)
 	td = &per_cpu(tick_cpu_device, cpu);
 	curdev = td->evtdev;
 
-	/* cpu local device ? */
-	if (!tick_check_percpu(curdev, newdev, cpu))
-		goto out_bc;
-
-	/* Preference decision */
-	if (!tick_check_preferred(curdev, newdev))
+	if (!tick_check_replacement(curdev, newdev))
 		goto out_bc;
 
 	if (!try_module_get(newdev->owner))

      reply	other threads:[~2021-04-16 19:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26  2:23 [PATCH] tick: Use the wrapped function to clear the logic Wang Wensheng
2021-04-16 19:07 ` tip-bot2 for Wang Wensheng [this message]

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=161860007631.29796.743363594563784489.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wangwensheng4@huawei.com \
    --cc=x86@kernel.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®