linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2] clockevents: Use list_move instead of list_del/list_add in clockevents.c
@ 2021-06-09  7:02 Baokun Li
  2021-06-22 15:22 ` [tip: timers/core] clockevents: Use list_move() instead of list_del()/list_add() tip-bot2 for Baokun Li
  0 siblings, 1 reply; 2+ messages in thread
From: Baokun Li @ 2021-06-09  7:02 UTC (permalink / raw)
  To: linux-kernel, Thomas Gleixner
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, libaokun1,
	kernel-janitors, Hulk Robot

Using list_move() instead of list_del() + list_add() in clockevents.c.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
V1->V2:
        CC mailist

 kernel/time/clockevents.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 0056d2bed53e..d59ac319f9f4 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -347,8 +347,7 @@ static void clockevents_notify_released(void)
 	while (!list_empty(&clockevents_released)) {
 		dev = list_entry(clockevents_released.next,
 				 struct clock_event_device, list);
-		list_del(&dev->list);
-		list_add(&dev->list, &clockevent_devices);
+		list_move(&dev->list, &clockevent_devices);
 		tick_check_new_device(dev);
 	}
 }
@@ -576,8 +575,7 @@ void clockevents_exchange_device(struct clock_event_device *old,
 	if (old) {
 		module_put(old->owner);
 		clockevents_switch_state(old, CLOCK_EVT_STATE_DETACHED);
-		list_del(&old->list);
-		list_add(&old->list, &clockevents_released);
+		list_move(&old->list, &clockevents_released);
 	}
 
 	if (new) {


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

* [tip: timers/core] clockevents: Use list_move() instead of list_del()/list_add()
  2021-06-09  7:02 [PATCH -next v2] clockevents: Use list_move instead of list_del/list_add in clockevents.c Baokun Li
@ 2021-06-22 15:22 ` tip-bot2 for Baokun Li
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Baokun Li @ 2021-06-22 15:22 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Hulk Robot, Baokun Li, Thomas Gleixner, x86, linux-kernel

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

Commit-ID:     4e82d2e20f3b11f253bc5c6e92f05ed3694a1ae3
Gitweb:        https://git.kernel.org/tip/4e82d2e20f3b11f253bc5c6e92f05ed3694a1ae3
Author:        Baokun Li <libaokun1@huawei.com>
AuthorDate:    Wed, 09 Jun 2021 15:02:42 +08:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 22 Jun 2021 17:16:46 +02:00

clockevents: Use list_move() instead of list_del()/list_add()

Simplify the code.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210609070242.1322450-1-libaokun1@huawei.com

---
 kernel/time/clockevents.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index bb9d2fe..003ccf3 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -347,8 +347,7 @@ static void clockevents_notify_released(void)
 	while (!list_empty(&clockevents_released)) {
 		dev = list_entry(clockevents_released.next,
 				 struct clock_event_device, list);
-		list_del(&dev->list);
-		list_add(&dev->list, &clockevent_devices);
+		list_move(&dev->list, &clockevent_devices);
 		tick_check_new_device(dev);
 	}
 }
@@ -576,8 +575,7 @@ void clockevents_exchange_device(struct clock_event_device *old,
 	if (old) {
 		module_put(old->owner);
 		clockevents_switch_state(old, CLOCK_EVT_STATE_DETACHED);
-		list_del(&old->list);
-		list_add(&old->list, &clockevents_released);
+		list_move(&old->list, &clockevents_released);
 	}
 
 	if (new) {

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

end of thread, other threads:[~2021-06-22 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09  7:02 [PATCH -next v2] clockevents: Use list_move instead of list_del/list_add in clockevents.c Baokun Li
2021-06-22 15:22 ` [tip: timers/core] clockevents: Use list_move() instead of list_del()/list_add() tip-bot2 for Baokun Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).