drivers: net: slip: use setup_timer() helper. [Linux 4.15]

This Linux kernel change "drivers: net: slip: use setup_timer() helper" is included in the Linux 4.15 release. This change is authored by Allen Pais <allen.lkml [at]> on Thu Sep 21 22:34:40 2017 +0530. The commit for this change in Linux stable tree is 18df06c (patch).

drivers: net: slip: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <>
Signed-off-by: David S. Miller <>

There are 8 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/net/slip/slip.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index 436dd78..eb8a189 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -763,12 +763,8 @@ static struct slip *sl_alloc(dev_t line)
    sl->mode        = SL_MODE_DEFAULT;
    /* initialize timer_list struct */
-   init_timer(&sl->keepalive_timer);
-   sl-> = (unsigned long)sl;
-   sl->keepalive_timer.function = sl_keepalive;
-   init_timer(&sl->outfill_timer);
-   sl-> = (unsigned long)sl;
-   sl->outfill_timer.function = sl_outfill;
+   setup_timer(&sl->keepalive_timer, sl_keepalive, (unsigned long)sl);
+   setup_timer(&sl->outfill_timer, sl_outfill, (unsigned long)sl);
    slip_devs[i] = dev;
    return sl;

Leave a Reply

Your email address will not be published. Required fields are marked *