Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/809056/?format=api
{ "id": 809056, "url": "http://patchwork.ozlabs.org/api/patches/809056/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170902090649.28426-2-antoine.tenart@free-electrons.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/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": "<20170902090649.28426-2-antoine.tenart@free-electrons.com>", "list_archive_url": null, "date": "2017-09-02T09:06:47", "name": "[net-next,v3,1/3] net: mvpp2: move the mac retrieval/copy logic into its own function", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "80391da79fe4de64b41b584377eefc6ed32bc295", "submitter": { "id": 61603, "url": "http://patchwork.ozlabs.org/api/people/61603/?format=api", "name": "Antoine Tenart", "email": "antoine.tenart@free-electrons.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170902090649.28426-2-antoine.tenart@free-electrons.com/mbox/", "series": [ { "id": 1145, "url": "http://patchwork.ozlabs.org/api/series/1145/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=1145", "date": "2017-09-02T09:06:49", "name": "net: mvpp2: improve the mac address retrieval logic", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/1145/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/809056/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/809056/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>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkqyq3NVJz9s75\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 2 Sep 2017 19:08:19 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751539AbdIBJHQ (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSat, 2 Sep 2017 05:07:16 -0400", "from mail.free-electrons.com ([62.4.15.54]:46053 \"EHLO\n\tmail.free-electrons.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750924AbdIBJHO (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sat, 2 Sep 2017 05:07:14 -0400", "by mail.free-electrons.com (Postfix, from userid 110)\n\tid 079F721D61; Sat, 2 Sep 2017 11:07:10 +0200 (CEST)", "from localhost (AToulouse-654-1-397-66.w90-55.abo.wanadoo.fr\n\t[90.55.196.66])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id CFFF120A10;\n\tSat, 2 Sep 2017 11:07:09 +0200 (CEST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com", "X-Spam-Level": "", "X-Spam-Status": "No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT\n\tshortcircuit=ham autolearn=disabled version=3.4.0", "From": "Antoine Tenart <antoine.tenart@free-electrons.com>", "To": "davem@davemloft.net", "Cc": "Antoine Tenart <antoine.tenart@free-electrons.com>, andrew@lunn.ch,\n\tgregory.clement@free-electrons.com,\n\tthomas.petazzoni@free-electrons.com, nadavh@marvell.com,\n\tlinux@armlinux.org.uk, linux-kernel@vger.kernel.org,\n\tmw@semihalf.com, stefanc@marvell.com, netdev@vger.kernel.org", "Subject": "[PATCH net-next v3 1/3] net: mvpp2: move the mac retrieval/copy\n\tlogic into its own function", "Date": "Sat, 2 Sep 2017 11:06:47 +0200", "Message-Id": "<20170902090649.28426-2-antoine.tenart@free-electrons.com>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170902090649.28426-1-antoine.tenart@free-electrons.com>", "References": "<20170902090649.28426-1-antoine.tenart@free-electrons.com>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "The MAC retrieval has a quite complicated logic (which is broken). Moves\nit to its own function to prepare for patches fixing its logic, so that\nreviews are easier.\n\nSigned-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>\n---\n drivers/net/ethernet/marvell/mvpp2.c | 45 +++++++++++++++++++++---------------\n 1 file changed, 27 insertions(+), 18 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c\nindex d5624894152e..a702e60ba70d 100644\n--- a/drivers/net/ethernet/marvell/mvpp2.c\n+++ b/drivers/net/ethernet/marvell/mvpp2.c\n@@ -7465,6 +7465,31 @@ static bool mvpp2_port_has_tx_irqs(struct mvpp2 *priv,\n \treturn true;\n }\n \n+static void mvpp2_port_copy_mac_addr(struct net_device *dev, struct mvpp2 *priv,\n+\t\t\t\t struct device_node *port_node,\n+\t\t\t\t char **mac_from)\n+{\n+\tstruct mvpp2_port *port = netdev_priv(dev);\n+\tchar hw_mac_addr[ETH_ALEN] = {0};\n+\tconst char *dt_mac_addr;\n+\n+\tdt_mac_addr = of_get_mac_address(port_node);\n+\tif (dt_mac_addr && is_valid_ether_addr(dt_mac_addr)) {\n+\t\t*mac_from = \"device tree\";\n+\t\tether_addr_copy(dev->dev_addr, dt_mac_addr);\n+\t} else {\n+\t\tif (priv->hw_version == MVPP21)\n+\t\t\tmvpp21_get_mac_address(port, hw_mac_addr);\n+\t\tif (is_valid_ether_addr(hw_mac_addr)) {\n+\t\t\t*mac_from = \"hardware\";\n+\t\t\tether_addr_copy(dev->dev_addr, hw_mac_addr);\n+\t\t} else {\n+\t\t\t*mac_from = \"random\";\n+\t\t\teth_hw_addr_random(dev);\n+\t\t}\n+\t}\n+}\n+\n /* Ports initialization */\n static int mvpp2_port_probe(struct platform_device *pdev,\n \t\t\t struct device_node *port_node,\n@@ -7476,9 +7501,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,\n \tstruct mvpp2_port_pcpu *port_pcpu;\n \tstruct net_device *dev;\n \tstruct resource *res;\n-\tconst char *dt_mac_addr;\n-\tconst char *mac_from;\n-\tchar hw_mac_addr[ETH_ALEN] = {0};\n+\tchar *mac_from = \"\";\n \tunsigned int ntxqs, nrxqs;\n \tbool has_tx_irqs;\n \tu32 id;\n@@ -7587,21 +7610,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,\n \t\tgoto err_free_irq;\n \t}\n \n-\tdt_mac_addr = of_get_mac_address(port_node);\n-\tif (dt_mac_addr && is_valid_ether_addr(dt_mac_addr)) {\n-\t\tmac_from = \"device tree\";\n-\t\tether_addr_copy(dev->dev_addr, dt_mac_addr);\n-\t} else {\n-\t\tif (priv->hw_version == MVPP21)\n-\t\t\tmvpp21_get_mac_address(port, hw_mac_addr);\n-\t\tif (is_valid_ether_addr(hw_mac_addr)) {\n-\t\t\tmac_from = \"hardware\";\n-\t\t\tether_addr_copy(dev->dev_addr, hw_mac_addr);\n-\t\t} else {\n-\t\t\tmac_from = \"random\";\n-\t\t\teth_hw_addr_random(dev);\n-\t\t}\n-\t}\n+\tmvpp2_port_copy_mac_addr(dev, priv, port_node, &mac_from);\n \n \tport->tx_ring_size = MVPP2_MAX_TXD;\n \tport->rx_ring_size = MVPP2_MAX_RXD;\n", "prefixes": [ "net-next", "v3", "1/3" ] }