Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/830229/?format=api
{ "id": 830229, "url": "http://patchwork.ozlabs.org/api/1.2/patches/830229/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20171025105312.GA146589@beast/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/1.2/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20171025105312.GA146589@beast>", "list_archive_url": null, "date": "2017-10-25T10:53:12", "name": "drivers/net: realtek: Convert timers to use timer_setup()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "7758e4f05c272b100de2744165c7fa2b93685c1d", "submitter": { "id": 10641, "url": "http://patchwork.ozlabs.org/api/1.2/people/10641/?format=api", "name": "Kees Cook", "email": "keescook@chromium.org" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/1.2/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20171025105312.GA146589@beast/mbox/", "series": [ { "id": 10138, "url": "http://patchwork.ozlabs.org/api/1.2/series/10138/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=10138", "date": "2017-10-25T10:53:12", "name": "drivers/net: realtek: Convert timers to use timer_setup()", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/10138/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/830229/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/830229/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"lZXqvg1e\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yMRnf6g4Kz9sPm\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 25 Oct 2017 21:53:26 +1100 (AEDT)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S932572AbdJYKxQ (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 25 Oct 2017 06:53:16 -0400", "from mail-pf0-f193.google.com ([209.85.192.193]:50051 \"EHLO\n\tmail-pf0-f193.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S932413AbdJYKxO (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 25 Oct 2017 06:53:14 -0400", "by mail-pf0-f193.google.com with SMTP id i5so21947802pfe.6\n\tfor <netdev@vger.kernel.org>; Wed, 25 Oct 2017 03:53:14 -0700 (PDT)", "from www.outflux.net\n\t(173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133])\n\tby smtp.gmail.com with ESMTPSA id\n\ta17sm5975353pfk.173.2017.10.25.03.53.12\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 25 Oct 2017 03:53:12 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google;\n\th=date:from:to:cc:subject:message-id:mime-version:content-disposition;\n\tbh=+0SLfZcKkTcAneO44QBafN8zwwMedaAaSGpmgkUZazQ=;\n\tb=lZXqvg1eMjO85hNsdbHBTCj2Ae8Uckfi5HqEvEWxecKBBQGTKWcwbMW3EYp5kwhRVK\n\t3pYAwpLugvLc7IT7yvMZ1C2Hk25aV5BADGWnn0f4b9x1HAJzZVKzUDXmPAJDGkTbtZSq\n\t5P8cXR6Hwv9rj58iYamzu3DPzDIpoIqZyQKio=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version\n\t:content-disposition;\n\tbh=+0SLfZcKkTcAneO44QBafN8zwwMedaAaSGpmgkUZazQ=;\n\tb=esp9lrnY1q/Mcm5I/aUHxyKKzIhMgwvyCu/ZjET5RoXXtWAWyiiWJpDStxw9u6nFrz\n\tq9YuAHNVKe4ngE6FOwl7TEX/MkjEyEjug2cMrJmbFhboOZbit931bSGEwgELOQJCJMua\n\tmqazhfL8mVYF9W6GorWuOVuOqA8u7VC4HuYInVtpInxruc7nBnceL9isxzpxY4SvJbq5\n\t+ftYE0imMQ70pc456KQF0ilMcSHbTrBkEeOkPtejP6Ba7qBO27sMpRj7YE9UgCS/6VKp\n\tnMKxYjPL4VnXRrAKLiwiFvCLXP7T+KsSycFMZvKiKKvm4o0FmQ7SY1B0xN4NyFfJop7M\n\tpPZg==", "X-Gm-Message-State": "AMCzsaVyBqMBOScflN2VCpJDOJxw6giLnnFBSxyn5oQZSCG/m0c1jl8l\n\t2EYeZvKHurY+ZDna6nCrCqz0Pw==", "X-Google-Smtp-Source": "ABhQp+T+BoSXK0SixshYZKR3JSryBug2LekXxQPhScb34906316upc+wF5gBB5P4daCTvJ2opOdosQ==", "X-Received": "by 10.101.75.7 with SMTP id r7mr1661260pgq.133.1508928793971;\n\tWed, 25 Oct 2017 03:53:13 -0700 (PDT)", "Date": "Wed, 25 Oct 2017 03:53:12 -0700", "From": "Kees Cook <keescook@chromium.org>", "To": "\"David S. Miller\" <davem@davemloft.net>", "Cc": "Realtek linux nic maintainers <nic_swsd@realtek.com>,\n\tDavid Howells <dhowells@redhat.com>,\n\tJay Vosburgh <jay.vosburgh@canonical.com>,\n\tAllen Pais <allen.lkml@gmail.com>, Eric Dumazet <edumazet@google.com>,\n\tTobias Klauser <tklauser@distanz.ch>, netdev@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org", "Subject": "[PATCH] drivers/net: realtek: Convert timers to use timer_setup()", "Message-ID": "<20171025105312.GA146589@beast>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=us-ascii", "Content-Disposition": "inline", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "In preparation for unconditionally passing the struct timer_list pointer to\nall timer callbacks, switch to using the new timer_setup() and from_timer()\nto pass the timer pointer explicitly.\n\nCc: Realtek linux nic maintainers <nic_swsd@realtek.com>\nCc: \"David S. Miller\" <davem@davemloft.net>\nCc: David Howells <dhowells@redhat.com>\nCc: Jay Vosburgh <jay.vosburgh@canonical.com>\nCc: Allen Pais <allen.lkml@gmail.com>\nCc: Eric Dumazet <edumazet@google.com>\nCc: Tobias Klauser <tklauser@distanz.ch>\nCc: netdev@vger.kernel.org\nSigned-off-by: Kees Cook <keescook@chromium.org>\n---\n drivers/net/ethernet/realtek/atp.c | 12 +++++++-----\n drivers/net/ethernet/realtek/r8169.c | 7 +++----\n 2 files changed, 10 insertions(+), 9 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/realtek/atp.c b/drivers/net/ethernet/realtek/atp.c\nindex bdc3833fab7e..7e011c1c1e6e 100644\n--- a/drivers/net/ethernet/realtek/atp.c\n+++ b/drivers/net/ethernet/realtek/atp.c\n@@ -170,6 +170,7 @@ struct net_local {\n spinlock_t lock;\n struct net_device *next_module;\n struct timer_list timer;\t/* Media selection timer. */\n+ struct net_device *dev;\t/* Timer dev. */\n unsigned long last_rx_time;\t/* Last Rx, in jiffies, to handle Rx hang. */\n int saved_tx_size;\n unsigned int tx_unit_busy:1;\n@@ -184,7 +185,7 @@ struct net_local {\n #define TIMED_CHECKER (HZ/4)\n #ifdef TIMED_CHECKER\n #include <linux/timer.h>\n-static void atp_timed_checker(unsigned long ignored);\n+static void atp_timed_checker(struct timer_list *t);\n #endif\n \n /* Index to functions, as function prototypes. */\n@@ -438,7 +439,8 @@ static int net_open(struct net_device *dev)\n \n \thardware_init(dev);\n \n-\tsetup_timer(&lp->timer, atp_timed_checker, (unsigned long)dev);\n+\tlp->dev = dev;\n+\ttimer_setup(&lp->timer, atp_timed_checker, 0);\n \tlp->timer.expires = jiffies + TIMED_CHECKER;\n \tadd_timer(&lp->timer);\n \n@@ -708,11 +710,11 @@ static irqreturn_t atp_interrupt(int irq, void *dev_instance)\n #ifdef TIMED_CHECKER\n /* This following code fixes a rare (and very difficult to track down)\n problem where the adapter forgets its ethernet address. */\n-static void atp_timed_checker(unsigned long data)\n+static void atp_timed_checker(struct timer_list *t)\n {\n-\tstruct net_device *dev = (struct net_device *)data;\n+\tstruct net_local *lp = from_timer(lp, t, timer);\n+\tstruct net_device *dev = lp->dev;\n \tlong ioaddr = dev->base_addr;\n-\tstruct net_local *lp = netdev_priv(dev);\n \tint tickssofar = jiffies - lp->last_rx_time;\n \tint i;\n \ndiff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c\nindex a3c949ea7d1a..7dc4b6de31e6 100644\n--- a/drivers/net/ethernet/realtek/r8169.c\n+++ b/drivers/net/ethernet/realtek/r8169.c\n@@ -4401,10 +4401,9 @@ static void rtl_schedule_task(struct rtl8169_private *tp, enum rtl_flag flag)\n \t\tschedule_work(&tp->wk.work);\n }\n \n-static void rtl8169_phy_timer(unsigned long __opaque)\n+static void rtl8169_phy_timer(struct timer_list *t)\n {\n-\tstruct net_device *dev = (struct net_device *)__opaque;\n-\tstruct rtl8169_private *tp = netdev_priv(dev);\n+\tstruct rtl8169_private *tp = from_timer(tp, t, timer);\n \n \trtl_schedule_task(tp, RTL_FLAG_TASK_PHY_PENDING);\n }\n@@ -8454,7 +8453,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)\n \ttp->opts1_mask = (tp->mac_version != RTL_GIGA_MAC_VER_01) ?\n \t\t~(RxBOVF | RxFOVF) : ~0;\n \n-\tsetup_timer(&tp->timer, rtl8169_phy_timer, (unsigned long)dev);\n+\ttimer_setup(&tp->timer, rtl8169_phy_timer, 0);\n \n \ttp->rtl_fw = RTL_FIRMWARE_UNKNOWN;\n \n", "prefixes": [] }