Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/919093/?format=api
{ "id": 919093, "url": "http://patchwork.ozlabs.org/api/patches/919093/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180523120813.14800-1-yuehaibing@huawei.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20180523120813.14800-1-yuehaibing@huawei.com>", "list_archive_url": null, "date": "2018-05-23T12:08:13", "name": "[net-next] ixgbe: introduce a helper to simplify code", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "3a25c2996150f83e6bdc8ab138e5093e9cb8e096", "submitter": { "id": 70610, "url": "http://patchwork.ozlabs.org/api/people/70610/?format=api", "name": "Yue Haibing", "email": "yuehaibing@huawei.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180523120813.14800-1-yuehaibing@huawei.com/mbox/", "series": [ { "id": 46121, "url": "http://patchwork.ozlabs.org/api/series/46121/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=46121", "date": "2018-05-23T12:08:13", "name": "[net-next] ixgbe: introduce a helper to simplify code", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/46121/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/919093/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/919093/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=huawei.com" ], "Received": [ "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 40rZLj3QS0z9s1d\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 24 May 2018 00:16:12 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 24651895A2;\n\tWed, 23 May 2018 14:16:11 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id NcrfYwntL+HO; Wed, 23 May 2018 14:16:09 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 6D88B8958E;\n\tWed, 23 May 2018 14:16:09 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id A00A71C2172\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 23 May 2018 12:08:31 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 9C5882C943\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 23 May 2018 12:08:31 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 7kqrfcT4Vurw for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 23 May 2018 12:08:30 +0000 (UTC)", "from huawei.com (unknown [45.249.212.35])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 812CA2216A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 23 May 2018 12:08:30 +0000 (UTC)", "from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58])\n\tby Forcepoint Email with ESMTP id 645B89A93DC27;\n\tWed, 23 May 2018 20:08:25 +0800 (CST)", "from localhost (10.177.31.96) by DGGEMS402-HUB.china.huawei.com\n\t(10.3.19.202) with Microsoft SMTP Server id 14.3.382.0;\n\tWed, 23 May 2018 20:08:20 +0800" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "From": "YueHaibing <yuehaibing@huawei.com>", "To": "<davem@davemloft.net>, <jeffrey.t.kirsher@intel.com>", "Date": "Wed, 23 May 2018 20:08:13 +0800", "Message-ID": "<20180523120813.14800-1-yuehaibing@huawei.com>", "X-Mailer": "git-send-email 2.10.2.windows.1", "MIME-Version": "1.0", "X-Originating-IP": "[10.177.31.96]", "X-CFilter-Loop": "Reflected", "X-Mailman-Approved-At": "Wed, 23 May 2018 14:16:08 +0000", "Subject": "[Intel-wired-lan] [PATCH net-next] ixgbe: introduce a helper to\n\tsimplify code", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>", "Cc": "netdev@vger.kernel.org, YueHaibing <yuehaibing@huawei.com>,\n\tintel-wired-lan@lists.osuosl.org", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "ixgbe_dbg_reg_ops_read and ixgbe_dbg_netdev_ops_read copy-pasting\nthe same code except for ixgbe_dbg_netdev_ops_buf/ixgbe_dbg_reg_ops_buf,\nso introduce a helper ixgbe_dbg_common_ops_read to remove redundant code.\n\nSigned-off-by: YueHaibing <yuehaibing@huawei.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 57 +++++++++---------------\n 1 file changed, 21 insertions(+), 36 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c\nindex 55fe811..50dfb02 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c\n@@ -10,15 +10,9 @@ static struct dentry *ixgbe_dbg_root;\n \n static char ixgbe_dbg_reg_ops_buf[256] = \"\";\n \n-/**\n- * ixgbe_dbg_reg_ops_read - read for reg_ops datum\n- * @filp: the opened file\n- * @buffer: where to write the data for the user to read\n- * @count: the size of the user's buffer\n- * @ppos: file position offset\n- **/\n-static ssize_t ixgbe_dbg_reg_ops_read(struct file *filp, char __user *buffer,\n-\t\t\t\t size_t count, loff_t *ppos)\n+static ssize_t ixgbe_dbg_common_ops_read(struct file *filp, char __user *buffer,\n+\t\t\t\t\t size_t count, loff_t *ppos,\n+\t\t\t\t\t char *dbg_buf)\n {\n \tstruct ixgbe_adapter *adapter = filp->private_data;\n \tchar *buf;\n@@ -29,8 +23,7 @@ static ssize_t ixgbe_dbg_reg_ops_read(struct file *filp, char __user *buffer,\n \t\treturn 0;\n \n \tbuf = kasprintf(GFP_KERNEL, \"%s: %s\\n\",\n-\t\t\tadapter->netdev->name,\n-\t\t\tixgbe_dbg_reg_ops_buf);\n+\t\t\tadapter->netdev->name, dbg_buf);\n \tif (!buf)\n \t\treturn -ENOMEM;\n \n@@ -46,6 +39,20 @@ static ssize_t ixgbe_dbg_reg_ops_read(struct file *filp, char __user *buffer,\n }\n \n /**\n+ * ixgbe_dbg_reg_ops_read - read for reg_ops datum\n+ * @filp: the opened file\n+ * @buffer: where to write the data for the user to read\n+ * @count: the size of the user's buffer\n+ * @ppos: file position offset\n+ **/\n+static ssize_t ixgbe_dbg_reg_ops_read(struct file *filp, char __user *buffer,\n+\t\t\t\t size_t count, loff_t *ppos)\n+{\n+\treturn ixgbe_dbg_common_ops_read(filp, buffer, count, ppos,\n+\t\t\t\t\t ixgbe_dbg_reg_ops_buf);\n+}\n+\n+/**\n * ixgbe_dbg_reg_ops_write - write into reg_ops datum\n * @filp: the opened file\n * @buffer: where to find the user's data\n@@ -121,33 +128,11 @@ static char ixgbe_dbg_netdev_ops_buf[256] = \"\";\n * @count: the size of the user's buffer\n * @ppos: file position offset\n **/\n-static ssize_t ixgbe_dbg_netdev_ops_read(struct file *filp,\n-\t\t\t\t\t char __user *buffer,\n+static ssize_t ixgbe_dbg_netdev_ops_read(struct file *filp, char __user *buffer,\n \t\t\t\t\t size_t count, loff_t *ppos)\n {\n-\tstruct ixgbe_adapter *adapter = filp->private_data;\n-\tchar *buf;\n-\tint len;\n-\n-\t/* don't allow partial reads */\n-\tif (*ppos != 0)\n-\t\treturn 0;\n-\n-\tbuf = kasprintf(GFP_KERNEL, \"%s: %s\\n\",\n-\t\t\tadapter->netdev->name,\n-\t\t\tixgbe_dbg_netdev_ops_buf);\n-\tif (!buf)\n-\t\treturn -ENOMEM;\n-\n-\tif (count < strlen(buf)) {\n-\t\tkfree(buf);\n-\t\treturn -ENOSPC;\n-\t}\n-\n-\tlen = simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf));\n-\n-\tkfree(buf);\n-\treturn len;\n+\treturn ixgbe_dbg_common_ops_read(filp, buffer, count, ppos,\n+\t\t\t\t\t ixgbe_dbg_netdev_ops_buf);\n }\n \n /**\n", "prefixes": [ "net-next" ] }