Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753914AbbFJFkO (ORCPT ); Wed, 10 Jun 2015 01:40:14 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34269 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751615AbbFJFkL (ORCPT ); Wed, 10 Jun 2015 01:40:11 -0400 Date: Wed, 10 Jun 2015 11:10:05 +0530 From: Vaishali Thakkar To: Chas Williams <3chas3@gmail.com> Cc: linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, julia.lawall@lip6.fr Subject: [PATCH] atm: idt77105: Use setup_timer Message-ID: <20150610054005.GA12228@vaishali-Ideapad-Z570> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1563 Lines: 49 Use the timer API function setup_timer instead of structure field assignments to initialize a timer. A simplified version of the Coccinelle semantic patch that performs this transformation is as follows: @change@ expression e1, e2, a; @@ -init_timer(&e1); +setup_timer(&e1, a, 0UL); ... when != a = e2 -e1.function = a; Signed-off-by: Vaishali Thakkar --- drivers/atm/idt77105.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c index 909c95b..feb023d 100644 --- a/drivers/atm/idt77105.c +++ b/drivers/atm/idt77105.c @@ -306,14 +306,12 @@ static int idt77105_start(struct atm_dev *dev) if (start_timer) { start_timer = 0; - init_timer(&stats_timer); + setup_timer(&stats_timer, idt77105_stats_timer_func, 0UL); stats_timer.expires = jiffies+IDT77105_STATS_TIMER_PERIOD; - stats_timer.function = idt77105_stats_timer_func; add_timer(&stats_timer); - init_timer(&restart_timer); + setup_timer(&restart_timer, idt77105_restart_timer_func, 0UL); restart_timer.expires = jiffies+IDT77105_RESTART_TIMER_PERIOD; - restart_timer.function = idt77105_restart_timer_func; add_timer(&restart_timer); } spin_unlock_irqrestore(&idt77105_priv_lock, flags); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/