Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752620AbbBKKpi (ORCPT ); Wed, 11 Feb 2015 05:45:38 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:56980 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751442AbbBKKph (ORCPT ); Wed, 11 Feb 2015 05:45:37 -0500 Date: Wed, 11 Feb 2015 16:15:31 +0530 From: Vaishali Thakkar To: Greg Kroah-Hartman Cc: Yijing Wang , Bjorn Helgaas , linux-pcmcia@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] pcmcia: Use setup_timer and mod_timer Message-ID: <20150211104530.GA23797@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: 2434 Lines: 73 This patch introduces the use of functions setup_timer and mod_timer. This is done using Coccinelle and semantic patch used for this as follows: // @@ expression x,y,z,a,b; @@ -init_timer (&x); +setup_timer (&x, y, z); +mod_timer (&a, b); -x.function = y; -x.data = z; -x.expires = b; -add_timer(&a); // Signed-off-by: Vaishali Thakkar --- drivers/pcmcia/pd6729.c | 8 +++----- drivers/pcmcia/yenta_socket.c | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index 34ace48..0f70b4d 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c @@ -707,11 +707,9 @@ static int pd6729_pci_probe(struct pci_dev *dev, } } else { /* poll Card status change */ - init_timer(&socket->poll_timer); - socket->poll_timer.function = pd6729_interrupt_wrapper; - socket->poll_timer.data = (unsigned long)socket; - socket->poll_timer.expires = jiffies + HZ; - add_timer(&socket->poll_timer); + setup_timer(&socket->poll_timer, pd6729_interrupt_wrapper, + (unsigned long)socket); + mod_timer(&socket->poll_timer, jiffies + HZ); } for (i = 0; i < MAX_SOCKETS; i++) { diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 8a23ccb..965bd84 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -1236,11 +1236,9 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id) if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, IRQF_SHARED, "yenta", socket)) { /* No IRQ or request_irq failed. Poll */ socket->cb_irq = 0; /* But zero is a valid IRQ number. */ - init_timer(&socket->poll_timer); - socket->poll_timer.function = yenta_interrupt_wrapper; - socket->poll_timer.data = (unsigned long)socket; - socket->poll_timer.expires = jiffies + HZ; - add_timer(&socket->poll_timer); + setup_timer(&socket->poll_timer, yenta_interrupt_wrapper, + (unsigned long)socket); + mod_timer(&socket->poll_timer, jiffies + HZ); dev_printk(KERN_INFO, &dev->dev, "no PCI IRQ, CardBus support disabled for this " "socket.\n"); -- 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/