From patchwork Tue Nov 15 20:28:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 20547 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2931190wru; Tue, 15 Nov 2022 12:40:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf57wjX8qW4TraHIbFiz2xDFZL5FXRbnc8SAKDPisz52BdYxGgfbWmIAr3Wzo5zS6cHSk/Kk X-Received: by 2002:a17:907:8c15:b0:78d:9e04:d8c2 with SMTP id ta21-20020a1709078c1500b0078d9e04d8c2mr14687724ejc.614.1668544800016; Tue, 15 Nov 2022 12:40:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668544800; cv=none; d=google.com; s=arc-20160816; b=Fl7QjBewxN5j2yNM8z+Q4fEs3Q4DV9rBgBPInyQlhJ5qnvqXDQ5v3MYTVuxrCIytOt r/FPkMeNJ56O/ARARSEuJiEfiDzAI4Z+sWlmgJednyODx9VFtbQus0QXMGs5yi56FQnY Q5rtwjcSNKhNDZW0MhSsxCSzcvQiiTA5WAVDSzh0bfx+ECdVxRxEywQQUsCaFPwge2Qs uxtoyFUPHE8FwSnujSkQ3/f2dVYnUeD1m+7XPE+AMm/XqlFd28fWxgnaDuVMRbIIBkX7 HfXFuAIE8bn2V+Cr8ikHLuRisIkWmOmmf8BezAIKHPX9sMvpvjVIr92HmrX8bJAoWvAX oxLQ== 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=hwBlr7gRdPWX+jcuURdCYYPD+CIC4n+uInKylO/pJp4=; b=vgu3rh7njPb+iJGKFPxGmXoD8FFq7TzXjDNx+iPW03NnxEt6CyXR3xQuTxJTGgYTde +HJr2LXEYqBoE2mRsKqMWGKaCnKViJ/sPlHr7QUEocn9lQDprGySa95+b7boLrucSgEg IFPg7lWxzeS2N2sGZtEzhWrW0N3Qd+XvYAUOwonOMSnOb1TUW2fUCDeP/vRQ/FG3511z AyzVQsRK1PHP892ZamDqc8Z7zyFd3Fa7tiS3PrHlT2upwzQ4evPoQn0E6KGX5JeZW4Dd 1jfnh15EwTawRG6ByhrE9QAAMCRMqzx6J5kl9VXmVJGaCa7jJXVxj4ThV7lx6YRyDuLm 7ifw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cujHDrZm; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 t5-20020a056402524500b00461992160edsi12848989edd.384.2022.11.15.12.39.35; Tue, 15 Nov 2022 12:39:59 -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=cujHDrZm; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S238351AbiKOUaB (ORCPT + 99 others); Tue, 15 Nov 2022 15:30:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236796AbiKOU3u (ORCPT ); Tue, 15 Nov 2022 15:29:50 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FB3D27DCC; Tue, 15 Nov 2022 12:28:49 -0800 (PST) Message-ID: <20221115202117.497653635@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668544128; 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=hwBlr7gRdPWX+jcuURdCYYPD+CIC4n+uInKylO/pJp4=; b=cujHDrZmE0+epA410xB6Bu9FcCpqiFA3XQwhDwRg6wOuiZmgkn8s/7d7AmmzCtox+smY9R WlNCN7BHjq8+OSfvTfSNMdbJgQ4dWTywfuH5I0RUBhCn75y8Vn+ERKeQyOBu0fVpDOUomz xz7N3ZyMftM2uYc4JdyTsdWNBHUXEqC6wZfRM1818iGAjiHcLLX7XwcAeUT1ypsCE5nESa EgN/YJkELwNPFBFQuErn2z/eR0k1Wm8SR0OPHy+8F0r2f/k6JP55uOtbcm8aaMyf6VAStL gdBGrY3pp6V+lPis2q7mffcsmFEGtu9yhQDMXzlsoGmlceCJmP5tOFiZAzFIcg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668544128; 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=hwBlr7gRdPWX+jcuURdCYYPD+CIC4n+uInKylO/pJp4=; b=HI3JwTkBI1GYhGcCHxXUijTPCARgWfZW+5HHmAbAr4btEdlS8X8hMiOZquMMmYRYAAHCIg mHAaonGXLg89MkBQ== 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 09/15] timers: Rename del_timer() to timer_delete() References: <20221115195802.415956561@linutronix.de> MIME-Version: 1.0 Date: Tue, 15 Nov 2022 21:28:48 +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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749596032317634058?= X-GMAIL-MSGID: =?utf-8?q?1749596032317634058?= 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 Reviewed-by: Steven Rostedt (Google) --- include/linux/timer.h | 15 ++++++++++++++- kernel/time/timer.c | 6 +++--- 2 files changed, 17 insertions(+), 4 deletions(-) --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -169,7 +169,6 @@ static inline int timer_pending(const st } 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 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 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 *); --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1252,7 +1252,7 @@ void add_timer_on(struct timer_list *tim EXPORT_SYMBOL_GPL(add_timer_on); /** - * del_timer - Deactivate a timer. + * timer_delete - Deactivate a timer. * @timer: The timer to be deactivated * * Contrary to timer_delete_sync() this function does not wait for an @@ -1264,7 +1264,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; @@ -1280,7 +1280,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