From patchwork Thu Nov 24 14:16:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 25572 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3426275wrr; Thu, 24 Nov 2022 06:21:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf4dNnRJBPv7caxxRZTk4iSL9fYmXMjLhdaembbu/7BhumHkqFqvEbIA7auJpq/gh5Ck1zL5 X-Received: by 2002:a65:6d95:0:b0:46f:f482:6920 with SMTP id bc21-20020a656d95000000b0046ff4826920mr11762911pgb.327.1669299713403; Thu, 24 Nov 2022 06:21:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669299713; cv=none; d=google.com; s=arc-20160816; b=mmmndfh7XSdZZir4nX/hn8mAUZiuOX51ir9A7PgDGc/VSjMImgHF8sKzgsGsB4U4Ri idY1SNzl56dqWUM7NKh5LcEK55UN0e67M3z15woV2hUkfTU1yWBHlbvKnoxJmX2w24Y/ 6MKPb4GnvIqbsAgjcwWR37esa0Apl/ErhjPyLlAx3Dtq7KMD8XgvZCRCIgRFG7rMUUXz V7fUHbfTQQb4rOIRyKt0ar6JVGEkUHoTjbc/hilJ9ZITZWPPFRXFHUPoU49ur/yLWNuZ jZZRsCgTyvJJwq0aYD59zN7FIjeNwQHt5EzFbxX7irrNZRSeg6k+zv80B60z6zmUl2BU 4XFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=wKe3v4JszgCQ32pHwFuEInMTWfs+D+9U/NSl7wN3OH0=; b=wbMZk1S//w/EsbXqsk1xgC7+IvmoZ0h7W6gjAGTtoa+2VHp8wsTZPEFWxuLLlqGJca mW3p7w/sn9zeolu+6LB+t5MYyy7SxjCjaBYkqbSv+6g1EUSDNuipFBiTIQtU9N2QuPSt sKp6mb1GxEu9pMNaU7X/kRjJynv7mNEa3fsDVzPkpIHKD6ey/KvjH+V9c6BQpCsbJGK2 /ELlQbYZY7y++09ffjxQjrY5Q7o2pelCYw3E6tW4NorejHLsZjYYvB+PhvuusVt8tgzI uXcQUYUoROg7ItkOyfkOXcaC8kd9BJG22j9CgPA+TLVpVWB3cbHGNLtS5SK6zqLCXDde +d+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=t+cjCLfB; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=SEDoo0zr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a056a001a0e00b00565c337c562si1247198pfv.100.2022.11.24.06.21.40; Thu, 24 Nov 2022 06:21:53 -0800 (PST) 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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=t+cjCLfB; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=SEDoo0zr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbiKXOQi (ORCPT + 99 others); Thu, 24 Nov 2022 09:16:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbiKXOQL (ORCPT ); Thu, 24 Nov 2022 09:16:11 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C42AFAE95; Thu, 24 Nov 2022 06:16:10 -0800 (PST) Date: Thu, 24 Nov 2022 14:16:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669299369; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wKe3v4JszgCQ32pHwFuEInMTWfs+D+9U/NSl7wN3OH0=; b=t+cjCLfBaVCwZEGPC+VYrmDgIEod64heVUR8p4uihLj4uOZTf61DVqgbWvSDP+l5kCdNpY N0N6QRBmwNodPObpaL8z5P4uKwuIUvNa713eLRLKUSpJ26lsRUEmqkqYW8l4OSV+BAe+9/ NujHmEbmnF1j7QHkDPA47W48AuZWI1WwZ4SZcYAH0PmmFDqy9YTRr9vFtS6ideX5Kq24Ex kuihaof0GfXtN8LLgUav7yVv2+GxlnwFwBfa1vWYzSI982QYpHbV1EW3ugMQ+DlmhXvR1j uKGpH2VJrbIWki5/R4Xncx3VxsfUmSNeTN8656G7O5YKzQxO+e/Ebht7aKiDSQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669299369; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wKe3v4JszgCQ32pHwFuEInMTWfs+D+9U/NSl7wN3OH0=; b=SEDoo0zrwXSQVuU11b40qbdRI5ph57LpaMSzU43ILszkb6oTuu12CeHfFYT6vFLznixKL1 RwCkFh7wGX2UGgDA== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] timers: Rename del_timer() to timer_delete() Cc: Thomas Gleixner , Guenter Roeck , "Steven Rostedt (Google)" , Jacob Keller , "Anna-Maria Behnsen" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221123201625.015535022@linutronix.de> References: <20221123201625.015535022@linutronix.de> MIME-Version: 1.0 Message-ID: <166929936781.4906.3245899515108947174.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750319741178965269?= X-GMAIL-MSGID: =?utf-8?q?1750387616012339029?= The following commit has been merged into the timers/core branch of tip: Commit-ID: bb663f0f3c396c6d05f6c5eeeea96ced20ff112e Gitweb: https://git.kernel.org/tip/bb663f0f3c396c6d05f6c5eeeea96ced20ff112e Author: Thomas Gleixner AuthorDate: Wed, 23 Nov 2022 21:18:45 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 24 Nov 2022 15:09:11 +01:00 timers: Rename del_timer() to timer_delete() The timer related functions do not have a strict timer_ prefixed namespace which is really annoying. Rename del_timer() to timer_delete() and provide del_timer() as a wrapper. Document that del_timer() is not for new code. Signed-off-by: Thomas Gleixner Tested-by: Guenter Roeck Reviewed-by: Steven Rostedt (Google) Reviewed-by: Jacob Keller Reviewed-by: Anna-Maria Behnsen Link: https://lore.kernel.org/r/20221123201625.015535022@linutronix.de --- include/linux/timer.h | 15 ++++++++++++++- kernel/time/timer.c | 6 +++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/linux/timer.h b/include/linux/timer.h index 551fa46..e338e17 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -169,7 +169,6 @@ static inline int timer_pending(const struct timer_list * timer) } extern void add_timer_on(struct timer_list *timer, int cpu); -extern int del_timer(struct timer_list * timer); extern int mod_timer(struct timer_list *timer, unsigned long expires); extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); extern int timer_reduce(struct timer_list *timer, unsigned long expires); @@ -184,6 +183,7 @@ extern void add_timer(struct timer_list *timer); extern int try_to_del_timer_sync(struct timer_list *timer); extern int timer_delete_sync(struct timer_list *timer); +extern int timer_delete(struct timer_list *timer); /** * del_timer_sync - Delete a pending timer and wait for a running callback @@ -198,6 +198,19 @@ static inline int del_timer_sync(struct timer_list *timer) return timer_delete_sync(timer); } +/** + * del_timer - Delete a pending timer + * @timer: The timer to be deleted + * + * See timer_delete() for detailed explanation. + * + * Do not use in new code. Use timer_delete() instead. + */ +static inline int del_timer(struct timer_list *timer) +{ + return timer_delete(timer); +} + extern void init_timers(void); struct hrtimer; extern enum hrtimer_restart it_real_fn(struct hrtimer *); diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 60e538b..2b5e8c2 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1257,7 +1257,7 @@ void add_timer_on(struct timer_list *timer, int cpu) EXPORT_SYMBOL_GPL(add_timer_on); /** - * del_timer - Deactivate a timer. + * timer_delete - Deactivate a timer * @timer: The timer to be deactivated * * The function only deactivates a pending timer, but contrary to @@ -1270,7 +1270,7 @@ EXPORT_SYMBOL_GPL(add_timer_on); * * %0 - The timer was not pending * * %1 - The timer was pending and deactivated */ -int del_timer(struct timer_list *timer) +int timer_delete(struct timer_list *timer) { struct timer_base *base; unsigned long flags; @@ -1286,7 +1286,7 @@ int del_timer(struct timer_list *timer) return ret; } -EXPORT_SYMBOL(del_timer); +EXPORT_SYMBOL(timer_delete); /** * try_to_del_timer_sync - Try to deactivate a timer