From patchwork Sun Sep 24 12:11:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 9967957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3A55760383 for ; Sun, 24 Sep 2017 12:12:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29DF0285AE for ; Sun, 24 Sep 2017 12:12:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1ED8A205FB; Sun, 24 Sep 2017 12:12:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SBL_CSS, RCVD_IN_SORBS_SPAM,RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 53E9928583 for ; Sun, 24 Sep 2017 12:12:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=pYPINvL9jGo6TZvPzeNb11HcpxewwRZcLnOUjRzFLXs=; b=eTl V1vVpcTMcOCFPxdG0JWJVhr95z011vGIgcwvKIzQAhQ99VWHNOfIe7cUPg85Xg2f3sbKN+0AdRuNC uBlvRJrYbj2PRV0/LmBCpwwSuUQDRWOwXlxmx5CRqpSSSj+ZaVOJaOpG6fNDhD3+d3pvtQjOaNct9 m7yMUhm+nt3JF2A2Q1E6zW2ezre0q7DVyhX54OyYZQy8KeCgUM/7CPZwqHRWeiUEcwEBp9WQrD4lq fZqXlYkGA3oHzCPCbLAvBi8mMAPjMPEH5Cd+sWX5CD4I3kE1TFbjWEn1MGOhz8M4yRG6CFAuBcP2k VBpK3d5jjpj0XlaRaJ+4JOEhk5pOoXg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dw5lX-0004DP-RB; Sun, 24 Sep 2017 12:12:07 +0000 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dw5lR-000471-Uw for linux-arm-kernel@lists.infradead.org; Sun, 24 Sep 2017 12:12:04 +0000 Received: by mail-pg0-x242.google.com with SMTP id u18so3374715pgo.1 for ; Sun, 24 Sep 2017 05:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=R05eoocSmdUIGH/HyKZMR8OWOv7Bm6bz/vEtsQN6+Xc=; b=fwz94W+DcT4MTJDXOzpYEulZmEhcNmNHwwJHntuFdLdkf6Npk4LKm5IxI/JoDv/rzM qrdtDxJI1F1Gaz2gMrZMvjZAs2vdx4Qd3uGsNcOoerhkA6cFsNBRuhmg2ys0aUpiOyxP foXL+wexpb7SrzAtDeIHOItwkpPLElmGm9zYNJgqhO72byc3r1uWFoPVjY8N/h5QEGz6 3+OaDIyI5Aw40u54xameMSIR2IXiEqeDinQ/HsEbUJ8Jzx3ugevUQ0G/F316adCBBwK3 hIjYw667RD1kAepnxc/uwYeC+h8dFnrOnbZx4sZ9o9f8a41StbQ3+3zELnEnbO9lxX4b gZNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=R05eoocSmdUIGH/HyKZMR8OWOv7Bm6bz/vEtsQN6+Xc=; b=isO7DtLh0vi8NuntJUqz8s0Y6O2xmis6v8PMYyEBnKQL4I4TSQ10G5FPGXNCPTIXeD YBoIihUgQwHu3iFZfNNOiwmiCKQxwuGHUgzEhJx+cKkBE15WQ4W5Gw+5vUO+zfSpLzHV cN4S8CMuYMzct69G59j/WitcK9NeYHWrsXjjZdYDf2CqmxVTnlFwe7vQerbFnOsHwc0i gQPV2ktQjQDV+nHd9994qUJXkf1t08OTrPBur/lLwuBSVT520SBhHsSDMA4QGAdIGj+n FuDQorC8TAd+FPFqwoWfP7L2CFm7FM6Q2+533rMIl/VhOX5ZvGrkozjSxUrbK4Behi1n CWKg== X-Gm-Message-State: AHPjjUi4iXnsiE+rczXahbpeBcR2FvDTFmx27wqpWlyXauRnpv5A27nC /mcY6tMqjzhSY0AFYrvY6Ww= X-Google-Smtp-Source: AOwi7QD6zpgDFJae0PGhR+ZPYhb+sWCpAYBuacV/V0DBh+eZDGLHMoXdkeHoUiO+MPGxGS58HrfO8g== X-Received: by 10.84.139.67 with SMTP id 61mr4502414plq.51.1506255100827; Sun, 24 Sep 2017 05:11:40 -0700 (PDT) Received: from localhost.localdomain ([103.254.204.108]) by smtp.gmail.com with ESMTPSA id p85sm7219388pfj.47.2017.09.24.05.11.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Sep 2017 05:11:39 -0700 (PDT) From: Himanshu Jha To: f.fainelli@gmail.com Subject: [PATCH] net: bcm63xx_enet: Use setup_timer and mod_timer Date: Sun, 24 Sep 2017 17:41:24 +0530 Message-Id: <1506255084-10943-1-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170924_051202_243854_DAD32A3A X-CRM114-Status: UNSURE ( 9.03 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yamada.masahiro@socionext.com, bcm-kernel-feedback-list@broadcom.com, Himanshu Jha , davem@davemloft.net, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use setup_timer and mod_timer API instead of structure assignments. 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: Himanshu Jha --- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index f8bbbbf..c6221f0 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -2331,11 +2331,8 @@ static int bcm_enetsw_open(struct net_device *dev) } /* start phy polling timer */ - init_timer(&priv->swphy_poll); - priv->swphy_poll.function = swphy_poll_timer; - priv->swphy_poll.data = (unsigned long)priv; - priv->swphy_poll.expires = jiffies; - add_timer(&priv->swphy_poll); + setup_timer(&priv->swphy_poll, swphy_poll_timer, (unsigned long)priv); + mod_timer(&priv->swphy_poll, jiffies); return 0; out: