lkml.org 
[lkml]   [2017]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 08/31] timer: Remove users of TIMER_INITIALIZER
    Date
    Drops the last user of TIMER_INITIALIZER and adapts timer.h to use the
    internal version.

    Signed-off-by: Kees Cook <keescook@chromium.org>
    ---
    drivers/char/tlclk.c | 7 +++----
    include/linux/timer.h | 2 +-
    2 files changed, 4 insertions(+), 5 deletions(-)

    diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c
    index 572a51704e67..f01efaa46f8e 100644
    --- a/drivers/char/tlclk.c
    +++ b/drivers/char/tlclk.c
    @@ -185,8 +185,7 @@ static int int_events; /* Event that generate a interrupt */
    static int got_event; /* if events processing have been done */

    static void switchover_timeout(unsigned long data);
    -static struct timer_list switchover_timer =
    - TIMER_INITIALIZER(switchover_timeout , 0, 0);
    +static struct timer_list switchover_timer;
    static unsigned long tlclk_timer_data;

    static struct tlclk_alarms *alarm_events;
    @@ -805,7 +804,8 @@ static int __init tlclk_init(void)
    goto out3;
    }

    - init_timer(&switchover_timer);
    + setup_timer(&switchover_timer, switchover_timeout,
    + (unsigned long)&tlclk_timer_data);

    ret = misc_register(&tlclk_miscdev);
    if (ret < 0) {
    @@ -922,7 +922,6 @@ static irqreturn_t tlclk_interrupt(int irq, void *dev_id)
    /* TIMEOUT in ~10ms */
    switchover_timer.expires = jiffies + msecs_to_jiffies(10);
    tlclk_timer_data = inb(TLCLK_REG1);
    - switchover_timer.data = (unsigned long) &tlclk_timer_data;
    mod_timer(&switchover_timer, switchover_timer.expires);
    } else {
    got_event = 1;
    diff --git a/include/linux/timer.h b/include/linux/timer.h
    index 491dfdda4acf..3f54800962aa 100644
    --- a/include/linux/timer.h
    +++ b/include/linux/timer.h
    @@ -87,7 +87,7 @@ struct timer_list {

    #define DEFINE_TIMER(_name, _function, _expires, _data) \
    struct timer_list _name = \
    - TIMER_INITIALIZER(_function, _expires, _data)
    + __TIMER_INITIALIZER(_function, _expires, _data, 0)

    void init_timer_key(struct timer_list *timer, unsigned int flags,
    const char *name, struct lock_class_key *key);
    --
    2.7.4
    \
     
     \ /
      Last update: 2017-09-01 01:31    [W:2.849 / U:0.476 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site