From patchwork Fri Nov 4 05:41:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 15342 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp190361wru; Thu, 3 Nov 2022 22:49:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4jAzqMM1mjA+tmZBya44VOEqpuLz8SZ3ce5BIsFG5SGlEcPvcPga4XRZ8ujMq/KFdfNZSx X-Received: by 2002:a05:6402:540d:b0:450:bda7:f76e with SMTP id ev13-20020a056402540d00b00450bda7f76emr13023191edb.249.1667540981883; Thu, 03 Nov 2022 22:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667540981; cv=none; d=google.com; s=arc-20160816; b=Z35u+xvDWOf7NNwKkoYGI3A4/ORpAgE6TkdO1nAfcBdoB2CINM+rOcWh92Dt1XaAXK ZGS0mQ3G4p8sH06QKv3zNztZNJIYfGlrqaivmab2OcwtpWz4NCXgZM6NFrm+xAZlA8Tv qK2CDEo8hW2CT7ktThso15eERDqpDsqoSkcsjvP8bpehTXtnLTREC1C+WXTDvg8QLYf7 6zGHB7FQxN9XmAvyAmFjmdmv6SmtATQBHILlEZdgdluAdYOBTdVWJsavpwSx14Ut3ujj yyyNQgA058FR3xdD2ppzAh6JpOPrAXmIoKs9XM0m1EKkmfFDnlbzTV5dk0rykZLzPDzH xXbg== 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=nLSfRMliSk5Aj86+A9mtcsqnSpvMsntb7Kgowu9QyKs=; b=wolbepAX410ZYyBJgqrlwsG5ofyjBKLiEX5zAEKgrfdlPdRAkWlFjmQm9HCxwSmsCC kwLU79t4ayY6K4ZJ7vSDOYJCrCmiWRee+9P9jvhvHmePbXuyHApDVIQn9eBqYSgSWfEX l3N6uYSExjIujmfDAAqCEPRzlv9t5PWQSx1u8VThipbjWx3cqlpQIEFZtTX9rgfaTGG1 zH0xqnKAM/ppN+2rK9nNkK0VT6GrnyMrfhBV+cza76UqUblSysoH1IW+VkBRKYUXPHy/ 59TQLEh+TE448GAHbeW3O7dUryOlIZEgh2TIdsmG52qwYNXhQX4AmEio8i1lDlS1RGm3 VEDA== 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 cs15-20020a170906dc8f00b0078e1b6060f7si4597276ejc.299.2022.11.03.22.49.18; Thu, 03 Nov 2022 22:49:41 -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 S231478AbiKDFtA (ORCPT + 99 others); Fri, 4 Nov 2022 01:49:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230240AbiKDFsu (ORCPT ); Fri, 4 Nov 2022 01:48:50 -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 E3DE72792C; Thu, 3 Nov 2022 22:48:47 -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 516D1620A7; Fri, 4 Nov 2022 05:48:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4A4DC43149; Fri, 4 Nov 2022 05:48:46 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1oqpZp-00711f-16; Fri, 04 Nov 2022 01:49:13 -0400 Message-ID: <20221104054913.171973223@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 04 Nov 2022 01:41:00 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds , Thomas Gleixner , Stephen Boyd , Guenter Roeck , Anna-Maria Gleixner , Andrew Morton , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [RFC][PATCH v3 07/33] timers: PM: Use timer_shutdown_sync() References: <20221104054053.431922658@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?1748543452962544929?= X-GMAIL-MSGID: =?utf-8?q?1748543452962544929?= 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 timer_shutdown_sync() 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) --- 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..c6d68bdcac68 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; + timer_shutdown_sync(&ws->timer); } EXPORT_SYMBOL_GPL(wakeup_source_remove);