Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b858e6f authored by Li Zefan's avatar Li Zefan Committed by Linus Torvalds
Browse files

clockevent: simplify list operations



list_for_each_safe() suffices here.

Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: john stultz <johnstul@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 818c3578
Loading
Loading
Loading
Loading
+4 −7
Original line number Original line Diff line number Diff line
@@ -218,6 +218,8 @@ void clockevents_exchange_device(struct clock_event_device *old,
 */
 */
void clockevents_notify(unsigned long reason, void *arg)
void clockevents_notify(unsigned long reason, void *arg)
{
{
	struct list_head *node, *tmp;

	spin_lock(&clockevents_lock);
	spin_lock(&clockevents_lock);
	clockevents_do_notify(reason, arg);
	clockevents_do_notify(reason, arg);


@@ -227,13 +229,8 @@ void clockevents_notify(unsigned long reason, void *arg)
		 * Unregister the clock event devices which were
		 * Unregister the clock event devices which were
		 * released from the users in the notify chain.
		 * released from the users in the notify chain.
		 */
		 */
		while (!list_empty(&clockevents_released)) {
		list_for_each_safe(node, tmp, &clockevents_released)
			struct clock_event_device *dev;
			list_del(node);

			dev = list_entry(clockevents_released.next,
					 struct clock_event_device, list);
			list_del(&dev->list);
		}
		break;
		break;
	default:
	default:
		break;
		break;