From patchwork Mon Jun 1 04:43:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 478772 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id EFAF4140FDF for ; Mon, 1 Jun 2015 14:44:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=YTp7UFOj; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 09318886A6; Mon, 1 Jun 2015 04:44:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FxCgM8WMuFYn; Mon, 1 Jun 2015 04:44:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 01A808863F; Mon, 1 Jun 2015 04:44:17 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 604931C0FB2 for ; Mon, 1 Jun 2015 04:44:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 56F3A32E07 for ; Mon, 1 Jun 2015 04:44:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q8sRezzBO9tx for ; Mon, 1 Jun 2015 04:44:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by silver.osuosl.org (Postfix) with ESMTPS id D4E1032CA1 for ; Mon, 1 Jun 2015 04:44:14 +0000 (UTC) Received: by pdbki1 with SMTP id ki1so98581886pdb.1 for ; Sun, 31 May 2015 21:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=77xzdohq8HHGAId2DgS4VYmkiUBb1Fu1XDapBhKBoCY=; b=YTp7UFOjnwGQguaf1To6aqitH2t1JkmcMJXr/ydToIT/VpDQCDPEat60G4yCC2c8Rk UK5BJ9gVW7rRUigjDARwK/NZzw5FEt1fKEYwOqSYeOHlHKa8Nk9rEn5FdTkPT5uR4KhK Iea2/WB6OjPlMbg0hQX2U30MpxgIfTHfA6heM20tdXIr5u0mJg9TksGxaoeDli4xY7xd COe2MQ6OH4ndkRtvAzUxBChr3fsV6jU8gzjbUx2Y7PxIHbJPVL+CYfMEoasJRcZhXjxw 8zQyVrg8YLkzOwRp8KEKVQnitGKglYQPRc9O8E9pfCmEMkhui9gIWG2vgjSptxekxBM5 3ecw== X-Received: by 10.70.89.138 with SMTP id bo10mr37546195pdb.146.1433133854275; Sun, 31 May 2015 21:44:14 -0700 (PDT) Received: from vaishali-Ideapad-Z570 ([43.249.235.159]) by mx.google.com with ESMTPSA id dc5sm12752072pbc.53.2015.05.31.21.43.53 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 31 May 2015 21:43:55 -0700 (PDT) Date: Mon, 1 Jun 2015 10:13:49 +0530 From: Vaishali Thakkar To: Jeff Kirsher Message-ID: <20150601044349.GA4730@vaishali-Ideapad-Z570> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: linux-kernel@vger.kernel.org, Julia Lawall , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: [Intel-wired-lan] [PATCH] ethernet/intel: Use setup_timer X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" 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, e3, e4, a, b; @@ -init_timer(&e1); +setup_timer(&e1, a, b); ... when != a = e2 when != b = e3 -e1.function = a; ... when != b = e4 -e1.data = b; Signed-off-by: Vaishali Thakkar --- drivers/net/ethernet/intel/e100.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c index 1a450f4..8ae9c0d 100644 --- a/drivers/net/ethernet/intel/e100.c +++ b/drivers/net/ethernet/intel/e100.c @@ -2922,9 +2922,7 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pci_set_master(pdev); - init_timer(&nic->watchdog); - nic->watchdog.function = e100_watchdog; - nic->watchdog.data = (unsigned long)nic; + setup_timer(&nic->watchdog, e100_watchdog, (unsigned long)nic); INIT_WORK(&nic->tx_timeout_task, e100_tx_timeout_task);