All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tick: Use the wrapped function to clear the logic
@ 2021-03-26  2:23 Wang Wensheng
  2021-04-16 19:07 ` [tip: timers/core] tick: Use tick_check_replacement() instead of open coding it tip-bot2 for Wang Wensheng
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Wensheng @ 2021-03-26  2:23 UTC (permalink / raw)
  To: fweisbec, tglx, mingo, linux-kernel; +Cc: rui.xiang

The function tick_check_replacement() is the combination of
tick_check_percpu() and tick_check_preferred(). It make the code easier to
understand to use the self-described one function.

Signed-off-by: Wang Wensheng <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))
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip: timers/core] tick: Use tick_check_replacement() instead of open coding it
  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
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Wang Wensheng @ 2021-04-16 19:07 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Wang Wensheng, Thomas Gleixner, x86, linux-kernel

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))

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-16 19:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26  2:23 [PATCH] tick: Use the wrapped function to clear the logic Wang Wensheng
2021-04-16 19:07 ` [tip: timers/core] tick: Use tick_check_replacement() instead of open coding it tip-bot2 for Wang Wensheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.