From patchwork Wed Oct 25 10:51:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 10026505 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 19B1760375 for ; Wed, 25 Oct 2017 10:52:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 080FC28AD3 for ; Wed, 25 Oct 2017 10:52:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0A5E28B3C; Wed, 25 Oct 2017 10:52:32 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham 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 8454B28AD3 for ; Wed, 25 Oct 2017 10:52:32 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date: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=lBbwpr0ZStYsyTXtHXI+DUt0BXo8jj2AHS6h1NwWLpA=; b=m4wxExxTq9VVzp EgWUKuMsc8WpkHm8hzuCZX9OOCQZtTjA2mUxw3lsIbhqNhsbvH1Y65h76JJgTpTT3kRFq5FMA4Nsl FRhYfRnBVZ0bjXy7FA641L7tJh+84wQ96U7NOSlcXgVcZtjdChTTHDRP7ZxMPb0EsYJyh2i6bm8o/ N5VcokqnCXwSFnAjb3qHeCxznNXfi1fPgqib9r2Sm6ETH9hqG6+1lrYzZrP81sFvmt53AHsn+oTj9 Gy077QkTDxqNW0dCnKDmM36B6b1jMeManwTA3XqrIvogC3nfhGcyqiC6xZn18Ik4uKF6Kt/vnpHk5 7YdZM+XFEaUU/2YXE1aQ==; 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 1e7JIP-0005ra-6a; Wed, 25 Oct 2017 10:52:25 +0000 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e7JIL-0005q8-Kq for linux-arm-kernel@lists.infradead.org; Wed, 25 Oct 2017 10:52:23 +0000 Received: by mail-pg0-x243.google.com with SMTP id l24so16996219pgu.11 for ; Wed, 25 Oct 2017 03:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=mzyJYKpioZw2bzNq5RFLp1u6Xvr8VRR9Dgthh5r5hmk=; b=WTG4dFwo/2L5P0XnevVUVZmHAaKlBQMvFRZgKuavG5jtfNcbNDtquey+tnrMPstdh9 2QE5QKq+14DM6xdJ6sLiGoLg7QutV57b24usL0I6r4cS7qgC0EXleGWnKaXurkIsNBF8 cX2xPBHnDTtSTrZrvkfBaQdUhSk9HHw3Ec48I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=mzyJYKpioZw2bzNq5RFLp1u6Xvr8VRR9Dgthh5r5hmk=; b=qQguTEBAQxpviPWwdCL8PRw0UoOKqOaA9GPxdA38ls+vU1yLSjtr0Prdmwkg0+PH7I dmVvg2Q6vfWfQj70l4SbdrIWW0Rx3Aq4WkagFGuROWX7ThKsGkchFxdukEwi7wdXNlYB BFhNC2dY8J/M+1hayEYqkDs9bmNwv5D6XVo4Y2QsLqsV63ary2AKoWtCMPqM2x6iJh+j +VMQChXPzHAoojk2O4OkHAMu6P+GkhGI6oIsk3XYMdMWke/Qd1yOrBpi2XP9gQSe3Q5R fjHIUeggvoc415LjRVPriUtKFOkitZ0mc+mbf4a++Z5zQih+1qL4fL1iJRZTl4Voc+fO T8qw== X-Gm-Message-State: AMCzsaXLuYlUfbStH1jywAfirZQeo1MVMXCneeuenhRHpgh3IRDtua6e gKXKB1KOQC/P1VeuGZKXZBqc4Q== X-Google-Smtp-Source: ABhQp+SpHmfdzj3rnFeKnCt1KPGPauWX+2f3V0rJWBCzq0Mr8sTUuK4MiOgZ+jj9nJiNWnc5ufx4lA== X-Received: by 10.98.211.220 with SMTP id z89mr1790353pfk.99.1508928720525; Wed, 25 Oct 2017 03:52:00 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id t78sm3794588pgb.93.2017.10.25.03.51.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 03:51:59 -0700 (PDT) Date: Wed, 25 Oct 2017 03:51:58 -0700 From: Kees Cook To: "David S. Miller" Subject: [PATCH] drivers/net: nuvoton: Convert timers to use timer_setup() Message-ID: <20171025105158.GA146575@beast> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171025_035221_712366_2FE3EED5 X-CRM114-Status: GOOD ( 11.62 ) 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: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Wan ZongShun , linux-kernel@vger.kernel.org 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 In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Wan ZongShun Cc: linux-arm-kernel@lists.infradead.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook --- drivers/net/ethernet/nuvoton/w90p910_ether.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/nuvoton/w90p910_ether.c b/drivers/net/ethernet/nuvoton/w90p910_ether.c index 4a67c55aa9f1..052b3d2c07a1 100644 --- a/drivers/net/ethernet/nuvoton/w90p910_ether.c +++ b/drivers/net/ethernet/nuvoton/w90p910_ether.c @@ -253,10 +253,10 @@ static void update_linkspeed(struct net_device *dev) netif_carrier_on(dev); } -static void w90p910_check_link(unsigned long dev_id) +static void w90p910_check_link(struct timer_list *t) { - struct net_device *dev = (struct net_device *) dev_id; - struct w90p910_ether *ether = netdev_priv(dev); + struct w90p910_ether *ether = from_timer(ether, t, check_timer); + struct net_device *dev = ether->mii.dev; update_linkspeed(dev); mod_timer(ðer->check_timer, jiffies + msecs_to_jiffies(1000)); @@ -957,8 +957,7 @@ static int w90p910_ether_setup(struct net_device *dev) ether->mii.mdio_read = w90p910_mdio_read; ether->mii.mdio_write = w90p910_mdio_write; - setup_timer(ðer->check_timer, w90p910_check_link, - (unsigned long)dev); + timer_setup(ðer->check_timer, w90p910_check_link, 0); return 0; }