Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7904877rwb; Wed, 23 Nov 2022 12:23:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf411T7p3eknqZAls4XEzB1InfRo+HchP3I9POkp7DEHr/0e7F5gT4gk603w4YaKo5QU4X4X X-Received: by 2002:a17:906:ad9a:b0:7ad:8bc6:48e4 with SMTP id la26-20020a170906ad9a00b007ad8bc648e4mr12056029ejb.514.1669234983116; Wed, 23 Nov 2022 12:23:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669234983; cv=none; d=google.com; s=arc-20160816; b=FalbB1HNVkJMO+GwXfI2IeC6cuCdca7dVUnLmXvoE7YK+BXuP7NwJ2N7GbJiyVv4n/ V7fX25UGPumFIBzTl2yAXJplA8FRC3aKSXYEMnId78ucewROuIkir4XNZzJfKOe/oU3Z BGriG7t/10urNsBDGNtK71dSJlRDUHNTze4Ih9VMx0L/GTvcgq3t7ErCkqPFos3kKX1Q qdHWvR8d2PgwBGB+5w5qzpquIeHgHQO0G2H8XEp3xdfov4g9aZJ5wh2NzoOPhC844z9U EH2rnzu6l7mOLX+xKwR3g3ku3wxpRfqaJg5rD2wZghlvW/E2JMMz/HE5tSDWavoTOf6V 12Kg== 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=5NDAS6/az4AeI8J230HSj0OuzxPfO5AK/cHGCm94sf4=; b=VQZJHHcyMNYIT7EmonDu31sCpjUH6JxNzXyTDDJ+KDsdxQJ+OFtyiv5neIcGt0GmY7 dE7bXfuXc8aieGyMllmatybKif4TvJqMzjynnNwXFF7T1+1j96SRFwJSX+5ueF5KCoWk NLhrCUIHE/ChgjoQCOtWcf8d1w/+Oi0q2TQN+oGx/3NXnBJ8OZ9M2yGCyvwpfeduxxzj Sq0OyKiGj5vsjASFivWnlxiFzirsOk2f6nuh6KLgoeAWgrpG4A7u8CUP5YMZdnVOPuK5 n2Bem7KtSIQhVGvxUT//HfCFzyBvaIP1fj6SzX59mof9APOZqyf9/p2k/nBxC6BZr/kl alJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZxiB0MoK; dkim=neutral (no key) header.i=@linutronix.de header.b=kxNsdont; 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 i15-20020a05640242cf00b00462e167b496si16987edc.317.2022.11.23.12.22.37; Wed, 23 Nov 2022 12:23:03 -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=ZxiB0MoK; dkim=neutral (no key) header.i=@linutronix.de header.b=kxNsdont; 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 S239816AbiKWUVm (ORCPT + 99 others); Wed, 23 Nov 2022 15:21:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239503AbiKWUUl (ORCPT ); Wed, 23 Nov 2022 15:20:41 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D42EFC4B53; Wed, 23 Nov 2022 12:18:59 -0800 (PST) Message-ID: <20221123201625.015535022@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669234726; 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=5NDAS6/az4AeI8J230HSj0OuzxPfO5AK/cHGCm94sf4=; b=ZxiB0MoKEhrDs6JnIu4R9zZvIUheLbc2riXKkak0s/kMJ+z/QTRv1YfxkAZT98MHKqvWDR JnwkfvYUgLO/yfLcHQDwbiPyKvRuiR9D2qGd2UgRPYFTDg8EB2PieJb1UVUdLJlgJ0RDqq Hw1PJgpylIREi/Q3si0wBnhaA3UM/iFFSUDDR+ES9CYcM7jJZYunTkw5YcpsAT20d5kDvY DE5w09yfOAp0lIiNXeoD35mQ98aBST+T5Ranv5Y6gbZL04Ro8iRo6/VR/5HHTQ+q24IIvU KQ+bQJsSBV13Sh6fzLn9iUEHtEc6uc5TeE7yR9BqTS2aSW3WAJF1A21dIEktyQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669234726; 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=5NDAS6/az4AeI8J230HSj0OuzxPfO5AK/cHGCm94sf4=; b=kxNsdontzmcLltKzlyA3jGnTy3ggg6p/i1u+bkF4W4Duiy/6aKUGPskh4Wph+aDmjevQ+j Q3HnhWipW9NtjHAA== 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, Jacob Keller Subject: [patch V3 10/17] timers: Rename del_timer() to timer_delete() References: <20221123201306.823305113@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Wed, 23 Nov 2022 21:18:45 +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 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) Reviewed-by: Jacob Keller Tested-by: Guenter Roeck --- 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 @@ -1257,7 +1257,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 * * 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