Commit-ID:  185981d54a60ae90942c6ba9006b250f3348cef2
Gitweb:     https://git.kernel.org/tip/185981d54a60ae90942c6ba9006b250f3348cef2
Author:     Kees Cook <keesc...@chromium.org>
AuthorDate: Wed, 4 Oct 2017 16:26:58 -0700
Committer:  Thomas Gleixner <t...@linutronix.de>
CommitDate: Thu, 5 Oct 2017 15:01:17 +0200

timer: Remove init_timer_pinned() in favor of timer_setup()

This refactors the only users of init_timer_pinned() to use
the new timer_setup() and from_timer(). Drops the definition of
init_timer_pinned().

Signed-off-by: Kees Cook <keesc...@chromium.org>
Signed-off-by: Thomas Gleixner <t...@linutronix.de>
Acked-by: David S. Miller <da...@davemloft.net> # for networking parts
Cc: linux-m...@linux-mips.org
Cc: Petr Mladek <pmla...@suse.com>
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Cc: Lai Jiangshan <jiangshan...@gmail.com>
Cc: Sebastian Reichel <s...@kernel.org>
Cc: Kalle Valo <kv...@qca.qualcomm.com>
Cc: Paul Mackerras <pau...@samba.org>
Cc: Pavel Machek <pa...@ucw.cz>
Cc: linux1394-de...@lists.sourceforge.net
Cc: Chris Metcalf <cmetc...@mellanox.com>
Cc: linux-s...@vger.kernel.org
Cc: linux-wirel...@vger.kernel.org
Cc: "James E.J. Bottomley" <j...@linux.vnet.ibm.com>
Cc: Wim Van Sebroeck <w...@iguana.be>
Cc: Michael Ellerman <m...@ellerman.id.au>
Cc: Ursula Braun <ubr...@linux.vnet.ibm.com>
Cc: Geert Uytterhoeven <ge...@linux-m68k.org>
Cc: Viresh Kumar <viresh.ku...@linaro.org>
Cc: Harish Patil <harish.pa...@cavium.com>
Cc: Stephen Boyd <sb...@codeaurora.org>
Cc: Guenter Roeck <li...@roeck-us.net>
Cc: Manish Chopra <manish.cho...@cavium.com>
Cc: Len Brown <len.br...@intel.com>
Cc: Arnd Bergmann <a...@arndb.de>
Cc: linux...@vger.kernel.org
Cc: Heiko Carstens <heiko.carst...@de.ibm.com>
Cc: Tejun Heo <t...@kernel.org>
Cc: Julian Wiedmann <j...@linux.vnet.ibm.com>
Cc: John Stultz <john.stu...@linaro.org>
Cc: Mark Gross <mark.gr...@intel.com>
Cc: linux-watch...@vger.kernel.org
Cc: linux-s...@vger.kernel.org
Cc: "Martin K. Petersen" <martin.peter...@oracle.com>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <r...@rjwysocki.net>
Cc: Oleg Nesterov <o...@redhat.com>
Cc: Ralf Baechle <r...@linux-mips.org>
Cc: Stefan Richter <stef...@s5r6.in-berlin.de>
Cc: Michael Reed <m...@sgi.com>
Cc: net...@vger.kernel.org
Cc: Martin Schwidefsky <schwidef...@de.ibm.com>
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: linuxppc-...@lists.ozlabs.org
Cc: Sudip Mukherjee <sudipm.mukher...@gmail.com>
Link: 
https://lkml.kernel.org/r/1507159627-127660-5-git-send-email-keesc...@chromium.org

---
 drivers/net/ethernet/tile/tilepro.c | 9 ++++-----
 include/linux/timer.h               | 2 --
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/tile/tilepro.c 
b/drivers/net/ethernet/tile/tilepro.c
index 49ccee4..56d0628 100644
--- a/drivers/net/ethernet/tile/tilepro.c
+++ b/drivers/net/ethernet/tile/tilepro.c
@@ -608,9 +608,9 @@ static void tile_net_schedule_egress_timer(struct 
tile_net_cpu *info)
  * ISSUE: Maybe instead track number of expected completions, and free
  * only that many, resetting to zero if "pending" is ever false.
  */
-static void tile_net_handle_egress_timer(unsigned long arg)
+static void tile_net_handle_egress_timer(struct timer_list *t)
 {
-       struct tile_net_cpu *info = (struct tile_net_cpu *)arg;
+       struct tile_net_cpu *info = from_timer(info, t, egress_timer);
        struct net_device *dev = info->napi.dev;
 
        /* The timer is no longer scheduled. */
@@ -1004,9 +1004,8 @@ static void tile_net_register(void *dev_ptr)
                BUG();
 
        /* Initialize the egress timer. */
-       init_timer_pinned(&info->egress_timer);
-       info->egress_timer.data = (long)info;
-       info->egress_timer.function = tile_net_handle_egress_timer;
+       timer_setup(&info->egress_timer, tile_net_handle_egress_timer,
+                   TIMER_PINNED);
 
        u64_stats_init(&info->stats.syncp);
 
diff --git a/include/linux/timer.h b/include/linux/timer.h
index b10c4bd..9da9035 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -128,8 +128,6 @@ static inline void init_timer_on_stack_key(struct 
timer_list *timer,
 
 #define init_timer(timer)                                              \
        __init_timer((timer), 0)
-#define init_timer_pinned(timer)                                       \
-       __init_timer((timer), TIMER_PINNED)
 #define init_timer_deferrable(timer)                                   \
        __init_timer((timer), TIMER_DEFERRABLE)
 

Reply via email to