From patchwork Thu Oct 27 15:05:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 619775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A492FA3742 for ; Thu, 27 Oct 2022 15:09:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236249AbiJ0PJZ (ORCPT ); Thu, 27 Oct 2022 11:09:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236245AbiJ0PJN (ORCPT ); Thu, 27 Oct 2022 11:09:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CB2118E73F; Thu, 27 Oct 2022 08:09:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ECCE06236E; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63875C433B5; Thu, 27 Oct 2022 15:09:11 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oo4Va-00BvVQ-1p; Thu, 27 Oct 2022 11:09:26 -0400 Message-ID: <20221027150926.394670044@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 27 Oct 2022 11:05:32 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [RFC][PATCH v2 07/31] timers: PM: Use del_timer_shutdown() References: <20221027150525.753064657@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: "Steven Rostedt (Google)" Instead of open coding making the timer look like it was not registered by setting the function pointer to NULL, call del_timer_shutdown() that does the same thing. Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home/ Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Pavel Machek Cc: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org Signed-off-by: Steven Rostedt (Google) Acked-by: Rafael J. Wysocki --- drivers/base/power/wakeup.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index 7cc0c0cf8eaa..c690f6c0d670 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -202,12 +202,7 @@ void wakeup_source_remove(struct wakeup_source *ws) raw_spin_unlock_irqrestore(&events_lock, flags); synchronize_srcu(&wakeup_srcu); - del_timer_sync(&ws->timer); - /* - * Clear timer.function to make wakeup_source_not_registered() treat - * this wakeup source as not registered. - */ - ws->timer.function = NULL; + del_timer_shutdown(&ws->timer); } EXPORT_SYMBOL_GPL(wakeup_source_remove);