Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7450619rwb; Tue, 15 Nov 2022 12:29:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf6H2zP2xrrbYmcWQ9072xHKdC5pEjxOcQ2S9hheyg64kFLSFJsReUAXD9+QyLYaxMHLtVkG X-Received: by 2002:a05:6a00:26ca:b0:56b:ac5c:f3dc with SMTP id p10-20020a056a0026ca00b0056bac5cf3dcmr19625883pfw.77.1668544164136; Tue, 15 Nov 2022 12:29:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668544164; cv=none; d=google.com; s=arc-20160816; b=tpZylElET+qVrEHxaP5HsrkF+aRRRu2AOxi6rfs/j78qL8zoZlqZ2w3/+BGup55QK3 kF83LvGBVk1eqZAS4fHZDJ/OTDlnIqxjHOZ8zk/Bg3Ge4twNjtsB5lfS6booKICw51PZ sE0RdkNKUzlr7Xnq7DJqNGDnEI0R5tkmYM+hEJLMyu9jEk1RXnUfvl00kZdOU7vDiUyZ Gu0ZPvntTvy36hTFKWxdmxxvEbmiRpwe84HK/RZk9h6nbVyvOBWYOiNFnjsONMtt86NP sxVcpITBpwJ8DBF3ZwOXA8BMfss7LvtVWxsOFR7krans/ci2cFWK0J8RTnRyps+Q0bH0 4trw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=3TBA6m8Bui7HopFhQ4Bz43kzwszNO0sb5x3eSnipnV0=; b=gZHIUtGWWzpSL+5d1+HA9KqZ6+/814EkZPCnYUnKhDMSlTvfpDr0A5Ej9It/uYPVh2 durouLkdsvbmLJ2j5iKC0C1r2MM34ZvgonEnT74qDPXProNLBoBAmZuKTKs1wuFe+/Gh 8BEBVt4T2GmRk/FU0L4TO4yMYNDh3tGMfAI0Kan6skAzRbj4jnHSj4alpWUEZ/Kln+bA su+VSeWjYSH1rRL3GWndz2/2v2fJXSsCW8ai/7EfN9OgfcF4q4y/2CdYgrUAShqAtIW2 uqimQwAO9DbUt3Ojy3WrH3KuruI7Q/EEHPd3C4A9OpAiz+dqFP1PrfN8xcvsnJCLc1V4 Qf1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CnGelLBE; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a63610a000000b00476d1591b76si1333708pgb.119.2022.11.15.12.29.12; Tue, 15 Nov 2022 12:29:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CnGelLBE; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231921AbiKOU2u (ORCPT + 99 others); Tue, 15 Nov 2022 15:28:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231640AbiKOU2m (ORCPT ); Tue, 15 Nov 2022 15:28:42 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1952BDE93; Tue, 15 Nov 2022 12:28:41 -0800 (PST) Message-ID: <20221115202117.212339280@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668544119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=3TBA6m8Bui7HopFhQ4Bz43kzwszNO0sb5x3eSnipnV0=; b=CnGelLBE0Fa85YjIR35gJaKjBm/eUBT0c7RRftGo7CvC9/gQL8eQiSl9bpw8uXwvYVj+5X YcgEmxPqRUsd/YsKCIV8sGkFHINcPbcrZn3Vftp4oPrdmAChvCzJRrsK446Iisg2irt67i UqyUYuZXLEKS3ms2Z5WSLe8nmYdFYXQW6qjVg90q4SXQOSRC+Y9Aqu5BwUBdnCOSykPlDy z0g9P2ZBAmmxbohG/ZSF4jpAhx3gGkubIHsCFOQEFCvSF7xIcyNXdJh7VtaAoTXHPl70Ih 7RjR05xoWFmNlKbGpDJg7876fzQuCCtnG83wUr88KKOq4I3yflOJ2mUS0C06Sg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668544119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=3TBA6m8Bui7HopFhQ4Bz43kzwszNO0sb5x3eSnipnV0=; b=RLinhQXJtS9wYfu34J619sF3m7jtZSMxOgQg18D6H7+Pz454qb6YYMDZ+510IR8kUAC3Ze Q2q1BB+iVBJasIAw== From: Thomas Gleixner To: LKML Cc: Linus Torvalds , Steven Rostedt , Anna-Maria Behnsen , Peter Zijlstra , Stephen Boyd , Guenter Roeck , Andrew Morton , Julia Lawall , Arnd Bergmann , Viresh Kumar , Marc Zyngier , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [patch 04/15] timers: Get rid of del_singleshot_timer_sync() References: <20221115195802.415956561@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Tue, 15 Nov 2022 21:28:39 +0100 (CET) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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-bluetooth@vger.kernel.org del_singleshot_timer_sync() used to be an optimization for deleting timers which are not rearmed from the timer callback function. This optimization turned out to be broken and got mapped to del_timer_sync() about 17 years ago. Get rid of the undocumented indirection and use del_timer_sync() directly. No functional change. Signed-off-by: Thomas Gleixner --- drivers/char/tpm/tpm-dev-common.c | 4 ++-- drivers/staging/wlan-ng/hfa384x_usb.c | 4 ++-- drivers/staging/wlan-ng/prism2usb.c | 6 +++--- include/linux/timer.h | 2 -- kernel/time/timer.c | 2 +- net/sunrpc/xprt.c | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) --- a/drivers/char/tpm/tpm-dev-common.c +++ b/drivers/char/tpm/tpm-dev-common.c @@ -155,7 +155,7 @@ ssize_t tpm_common_read(struct file *fil out: if (!priv->response_length) { *off = 0; - del_singleshot_timer_sync(&priv->user_read_timer); + del_timer_sync(&priv->user_read_timer); flush_work(&priv->timeout_work); } mutex_unlock(&priv->buffer_mutex); @@ -262,7 +262,7 @@ ssize_t tpm_common_write(struct file *fi void tpm_common_release(struct file *file, struct file_priv *priv) { flush_work(&priv->async_work); - del_singleshot_timer_sync(&priv->user_read_timer); + del_timer_sync(&priv->user_read_timer); flush_work(&priv->timeout_work); file->private_data = NULL; priv->response_length = 0; --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -1116,8 +1116,8 @@ static int hfa384x_usbctlx_complete_sync if (ctlx == get_active_ctlx(hw)) { spin_unlock_irqrestore(&hw->ctlxq.lock, flags); - del_singleshot_timer_sync(&hw->reqtimer); - del_singleshot_timer_sync(&hw->resptimer); + del_timer_sync(&hw->reqtimer); + del_timer_sync(&hw->resptimer); hw->req_timer_done = 1; hw->resp_timer_done = 1; usb_kill_urb(&hw->ctlx_urb); --- a/drivers/staging/wlan-ng/prism2usb.c +++ b/drivers/staging/wlan-ng/prism2usb.c @@ -170,9 +170,9 @@ static void prism2sta_disconnect_usb(str */ prism2sta_ifstate(wlandev, P80211ENUM_ifstate_disable); - del_singleshot_timer_sync(&hw->throttle); - del_singleshot_timer_sync(&hw->reqtimer); - del_singleshot_timer_sync(&hw->resptimer); + del_timer_sync(&hw->throttle); + del_timer_sync(&hw->reqtimer); + del_timer_sync(&hw->resptimer); /* Unlink all the URBs. This "removes the wheels" * from the entire CTLX handling mechanism. --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -190,8 +190,6 @@ extern int try_to_del_timer_sync(struct # define del_timer_sync(t) del_timer(t) #endif -#define del_singleshot_timer_sync(t) del_timer_sync(t) - extern void init_timers(void); struct hrtimer; extern enum hrtimer_restart it_real_fn(struct hrtimer *); --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1933,7 +1933,7 @@ signed long __sched schedule_timeout(sig timer_setup_on_stack(&timer.timer, process_timeout, 0); __mod_timer(&timer.timer, expire, MOD_TIMER_NOTPENDING); schedule(); - del_singleshot_timer_sync(&timer.timer); + del_timer_sync(&timer.timer); /* Remove the timer from the object tracker */ destroy_timer_on_stack(&timer.timer); --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c @@ -1164,7 +1164,7 @@ xprt_request_enqueue_receive(struct rpc_ spin_unlock(&xprt->queue_lock); /* Turn off autodisconnect */ - del_singleshot_timer_sync(&xprt->timer); + del_timer_sync(&xprt->timer); return 0; }