timer: Remove init_timer_pinned() in favor of timer_setup()
authorKees Cook <[email protected]>
Wed, 4 Oct 2017 23:26:58 +0000 (16:26 -0700)
committerThomas Gleixner <[email protected]>
Thu, 5 Oct 2017 13:01:17 +0000 (15:01 +0200)
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 <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: David S. Miller <[email protected]> # for networking parts
Cc: [email protected]
Cc: Petr Mladek <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: [email protected]
Cc: Chris Metcalf <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Wim Van Sebroeck <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Ursula Braun <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Harish Patil <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: Manish Chopra <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: [email protected]
Cc: Heiko Carstens <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Julian Wiedmann <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Mark Gross <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: "Martin K. Petersen" <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Stefan Richter <[email protected]>
Cc: Michael Reed <[email protected]>
Cc: [email protected]
Cc: Martin Schwidefsky <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: [email protected]
Cc: Sudip Mukherjee <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
drivers/net/ethernet/tile/tilepro.c
include/linux/timer.h

index 49ccee4b9aeccc3b6cd165b461d448f0aba7a6bd..56d06282fbde7343afa63f7df9b66fdd4fb10a5d 100644 (file)
@@ -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);
 
index b10c4bdc6fbd8c2821ed8a8159aae24a539310f3..9da903562ed4547463031212946d3035fca3a014 100644 (file)
@@ -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)