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: 11829 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp286679wru; Thu, 27 Oct 2022 08:11:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6WZM03AeFbjZOtlfJ5zJb5o+yCVfXZZrZJD2lJDKtmfNHUK8vW5Xlvp9/T1lNSDrGYoV/p X-Received: by 2002:a17:906:401:b0:73d:af73:b78 with SMTP id d1-20020a170906040100b0073daf730b78mr43862244eja.122.1666883469493; Thu, 27 Oct 2022 08:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666883469; cv=none; d=google.com; s=arc-20160816; b=hCul1+EOik9g6djUPwDT6P/u8zIeSvScGGNfPVe2O8t/Y0iRWBIKmIFuJW+jNlj6EU S4ihypELvN64fu5QmF70k8qmKnDAqUAyj49peBcsGA95nr6JdftFHn5Zt2K+A+ax2kYk jfWx/T4LGzTBOtUktU+mkEyJYraa1TrF73WItxIslgF9Kn70Y3zyymM/91gmMdugstuO UOG65VdkU46AoADQRhaUCeX3j6d5w33E30lEzY8Suw7HJaxuIH7zJKEmuDPRkslYoO8Z OqSiTGCWmI9Gs9N5orgn+MlIOLoxMTlEEhT2FwSnPkMCj6HY/k6IPOvPpbsr5mbor4bt t84A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=f5xOwNz6cYb7XAXe8w7TLgPXpRiJZWumV3U6aTiyNkk=; b=YwQ1NlArp/lQEkHswzAQoyKQqT1KsOvUs6C5tJxmLLSrHmIXiyIC9sTKfeKDb8iNEc YOp5hF/O32hSFIJArKax1WyzvqJo8jfiz0gx0wARlqU483rS7ZwJKjjizuSn+qQiBWeb vLdK7CBw9ckqB7YmW3lyM02ws5Fx6nPhdG+eZuiibO41bOZL6xE6943pEznDWP4VtLOb /AVQIcN3/SshjQFMG5ZtKSVARVZPgA1h3VyKLvNvMCrQKTPSrr7UdGHT6Qnd0NJh+M4Y ooBR7o3+9oMrexHvdwO0AKOZHxionaJPUQClrEzzHNPAs47tARaIlezF0clAyfbmdo1u eCYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s15-20020a50d48f000000b00457e9f88b90si1566018edi.246.2022.10.27.08.10.44; Thu, 27 Oct 2022 08:11:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236367AbiJ0PKJ (ORCPT + 99 others); Thu, 27 Oct 2022 11:10:09 -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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747854001007987340?= X-GMAIL-MSGID: =?utf-8?q?1747854001007987340?= 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);