Use setup_timer instead of structure field assignments to initialize a timer. mod_timer is a more efficient way to update the expire field of an active timer (if the timer is inactive it will be activated) Signed-off-by: Shyam Saini <mayhs11saini@xxxxxxxxx> --- drivers/scsi/esas2r/esas2r_main.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c index 5092c82..6ee4315 100644 --- a/drivers/scsi/esas2r/esas2r_main.c +++ b/drivers/scsi/esas2r/esas2r_main.c @@ -1635,14 +1635,8 @@ static void esas2r_timer_callback(unsigned long context); void esas2r_kickoff_timer(struct esas2r_adapter *a) { - init_timer(&a->timer); - - a->timer.function = esas2r_timer_callback; - a->timer.data = (unsigned long)a; - a->timer.expires = jiffies + - msecs_to_jiffies(100); - - add_timer(&a->timer); + setup_timer(&a->timer, esas2r_timer_callback, (unsigned long)a); + mod_timer(&a->timer, jiffies + msecs_to_jiffies(100)); } static void esas2r_timer_callback(unsigned long context) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html