get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/680967/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 680967,
    "url": "http://patchwork.ozlabs.org/api/patches/680967/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1476224818-16844-7-git-send-email-bimmy.pujari@intel.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": "<1476224818-16844-7-git-send-email-bimmy.pujari@intel.com>",
    "list_archive_url": null,
    "date": "2016-10-11T22:26:58",
    "name": "[next,S50,6/6] i40e: removed unreachable code",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9ca61b304b2f439d54842a2648f2b89f25faf04c",
    "submitter": {
        "id": 68919,
        "url": "http://patchwork.ozlabs.org/api/people/68919/?format=api",
        "name": "Pujari, Bimmy",
        "email": "bimmy.pujari@intel.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/1476224818-16844-7-git-send-email-bimmy.pujari@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/680967/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/680967/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.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"
        ],
        "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 3sts8r5pdTz9s9N\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 12 Oct 2016 09:28:44 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 6BB4E8A48B;\n\tTue, 11 Oct 2016 22:28:43 +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 zSj3jKvCm2bP; Tue, 11 Oct 2016 22:28:42 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id AB5DD898D0;\n\tTue, 11 Oct 2016 22:28:42 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id C72661CEB01\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 11 Oct 2016 22:28:38 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id C29388A49F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 11 Oct 2016 22:28:38 +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 OeTRqo0vv9jR for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 11 Oct 2016 22:28:27 +0000 (UTC)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id EB48A88C9A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 11 Oct 2016 22:28:26 +0000 (UTC)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga105.fm.intel.com with ESMTP; 11 Oct 2016 15:28:25 -0700",
            "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([134.134.2.167])\n\tby orsmga001.jf.intel.com with ESMTP; 11 Oct 2016 15:28:25 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.31,479,1473145200\"; d=\"scan'208\";\n\ta=\"1043428140\"",
        "From": "Bimmy Pujari <bimmy.pujari@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 11 Oct 2016 15:26:58 -0700",
        "Message-Id": "<1476224818-16844-7-git-send-email-bimmy.pujari@intel.com>",
        "X-Mailer": "git-send-email 2.4.11",
        "In-Reply-To": "<1476224818-16844-1-git-send-email-bimmy.pujari@intel.com>",
        "References": "<1476224818-16844-1-git-send-email-bimmy.pujari@intel.com>",
        "Cc": "Filip Sadowski <filip.sadowski@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S50 6/6] i40e: removed unreachable\n\tcode",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "From: Filip Sadowski <filip.sadowski@intel.com>\n\nRemoved some of unnecessary if statements and unreachable code found by\nstatic code analysis tool.\nThe return value of i40e_vsi_control_rings(..., false) is always 0. So,\ntest for non-zero will never be true. The function has been split into\n\"int i40e_vsi_start_rings()\" and \"void i40e_vsi_stop_rings()\" for better\nunderstanding.\nSimilarly, the function i40e_vsi_kill_vlan() never fails. So, checking\nfor return value is also unnecessary. Function definition changed to void.\nThe i40e_loopback_test() function is not impelemented. The function and\nall references to loopback testing were removed.\n\nSigned-off-by: Filip Sadowski <filip.sadowski@intel.com>\nChange-ID: Id45cf66f6689ce2bc4e887de13f073e30e8431bd\n---\nTesting hints:\n        Found by static code analysis. Test by code inspection.\n\n drivers/net/ethernet/intel/i40e/i40e.h             |  5 +--\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c     | 18 ----------\n drivers/net/ethernet/intel/i40e/i40e_main.c        | 41 ++++++++++++----------\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 29 +++++----------\n 4 files changed, 33 insertions(+), 60 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex bb02280..29c2318 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -773,7 +773,8 @@ void i40e_service_event_schedule(struct i40e_pf *pf);\n void i40e_notify_client_of_vf_msg(struct i40e_vsi *vsi, u32 vf_id,\n \t\t\t\t  u8 *msg, u16 len);\n \n-int i40e_vsi_control_rings(struct i40e_vsi *vsi, bool enable);\n+int i40e_vsi_start_rings(struct i40e_vsi *vsi);\n+void i40e_vsi_stop_rings(struct i40e_vsi *vsi);\n int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count);\n struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags, u16 uplink_seid,\n \t\t\t\tu16 downlink_seid, u8 enabled_tc);\n@@ -849,7 +850,7 @@ int i40e_close(struct net_device *netdev);\n int i40e_vsi_open(struct i40e_vsi *vsi);\n void i40e_vlan_stripping_disable(struct i40e_vsi *vsi);\n int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid);\n-int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid);\n+void i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid);\n struct i40e_mac_filter *i40e_put_mac_in_vlan(struct i40e_vsi *vsi,\n \t\t\t\t\t     const u8 *macaddr);\n int i40e_del_mac_all_vlan(struct i40e_vsi *vsi, const u8 *macaddr);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 962a9bb..b9e1162 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -216,7 +216,6 @@ enum i40e_ethtool_test_id {\n \tI40E_ETH_TEST_REG = 0,\n \tI40E_ETH_TEST_EEPROM,\n \tI40E_ETH_TEST_INTR,\n-\tI40E_ETH_TEST_LOOPBACK,\n \tI40E_ETH_TEST_LINK,\n };\n \n@@ -224,7 +223,6 @@ static const char i40e_gstrings_test[][ETH_GSTRING_LEN] = {\n \t\"Register test  (offline)\",\n \t\"Eeprom test    (offline)\",\n \t\"Interrupt test (offline)\",\n-\t\"Loopback test  (offline)\",\n \t\"Link test   (on/offline)\"\n };\n \n@@ -1744,17 +1742,6 @@ static int i40e_intr_test(struct net_device *netdev, u64 *data)\n \treturn *data;\n }\n \n-static int i40e_loopback_test(struct net_device *netdev, u64 *data)\n-{\n-\tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n-\tstruct i40e_pf *pf = np->vsi->back;\n-\n-\tnetif_info(pf, hw, netdev, \"loopback test not implemented\\n\");\n-\t*data = 0;\n-\n-\treturn *data;\n-}\n-\n static inline bool i40e_active_vfs(struct i40e_pf *pf)\n {\n \tstruct i40e_vf *vfs = pf->vf;\n@@ -1790,7 +1777,6 @@ static void i40e_diag_test(struct net_device *netdev,\n \t\t\tdata[I40E_ETH_TEST_REG]\t\t= 1;\n \t\t\tdata[I40E_ETH_TEST_EEPROM]\t= 1;\n \t\t\tdata[I40E_ETH_TEST_INTR]\t= 1;\n-\t\t\tdata[I40E_ETH_TEST_LOOPBACK]\t= 1;\n \t\t\tdata[I40E_ETH_TEST_LINK]\t= 1;\n \t\t\teth_test->flags |= ETH_TEST_FL_FAILED;\n \t\t\tclear_bit(__I40E_TESTING, &pf->state);\n@@ -1818,9 +1804,6 @@ static void i40e_diag_test(struct net_device *netdev,\n \t\tif (i40e_intr_test(netdev, &data[I40E_ETH_TEST_INTR]))\n \t\t\teth_test->flags |= ETH_TEST_FL_FAILED;\n \n-\t\tif (i40e_loopback_test(netdev, &data[I40E_ETH_TEST_LOOPBACK]))\n-\t\t\teth_test->flags |= ETH_TEST_FL_FAILED;\n-\n \t\t/* run reg test last, a reset is required after it */\n \t\tif (i40e_reg_test(netdev, &data[I40E_ETH_TEST_REG]))\n \t\t\teth_test->flags |= ETH_TEST_FL_FAILED;\n@@ -1841,7 +1824,6 @@ static void i40e_diag_test(struct net_device *netdev,\n \t\tdata[I40E_ETH_TEST_REG] = 0;\n \t\tdata[I40E_ETH_TEST_EEPROM] = 0;\n \t\tdata[I40E_ETH_TEST_INTR] = 0;\n-\t\tdata[I40E_ETH_TEST_LOOPBACK] = 0;\n \t}\n \n skip_ol_tests:\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex e4e2775..3ffc59c 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -2496,10 +2496,8 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)\n  * i40e_vsi_kill_vlan - Remove vsi membership for given vlan\n  * @vsi: the vsi being configured\n  * @vid: vlan id to be removed (0 = untagged only , -1 = any)\n- *\n- * Return: 0 on success or negative otherwise\n  **/\n-int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)\n+void i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)\n {\n \tstruct net_device *netdev = vsi->netdev;\n \tstruct i40e_mac_filter *f;\n@@ -2523,7 +2521,6 @@ int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)\n \t * applying the new filter changes\n \t */\n \ti40e_service_event_schedule(vsi->back);\n-\treturn 0;\n }\n \n /**\n@@ -4010,30 +4007,36 @@ static int i40e_vsi_control_rx(struct i40e_vsi *vsi, bool enable)\n }\n \n /**\n- * i40e_vsi_control_rings - Start or stop a VSI's rings\n+ * i40e_vsi_start_rings - Start a VSI's rings\n  * @vsi: the VSI being configured\n- * @enable: start or stop the rings\n  **/\n-int i40e_vsi_control_rings(struct i40e_vsi *vsi, bool request)\n+int i40e_vsi_start_rings(struct i40e_vsi *vsi)\n {\n \tint ret = 0;\n \n \t/* do rx first for enable and last for disable */\n-\tif (request) {\n-\t\tret = i40e_vsi_control_rx(vsi, request);\n-\t\tif (ret)\n-\t\t\treturn ret;\n-\t\tret = i40e_vsi_control_tx(vsi, request);\n-\t} else {\n-\t\t/* Ignore return value, we need to shutdown whatever we can */\n-\t\ti40e_vsi_control_tx(vsi, request);\n-\t\ti40e_vsi_control_rx(vsi, request);\n-\t}\n+\tret = i40e_vsi_control_rx(vsi, true);\n+\tif (ret)\n+\t\treturn ret;\n+\tret = i40e_vsi_control_tx(vsi, true);\n \n \treturn ret;\n }\n \n /**\n+ * i40e_vsi_stop_rings - Stop a VSI's rings\n+ * @vsi: the VSI being configured\n+ **/\n+void i40e_vsi_stop_rings(struct i40e_vsi *vsi)\n+{\n+\t/* do rx first for enable and last for disable\n+\t * Ignore return value, we need to shutdown whatever we can\n+\t */\n+\ti40e_vsi_control_tx(vsi, false);\n+\ti40e_vsi_control_rx(vsi, false);\n+}\n+\n+/**\n  * i40e_vsi_free_irq - Free the irq association with the OS\n  * @vsi: the VSI being configured\n  **/\n@@ -5231,7 +5234,7 @@ static int i40e_up_complete(struct i40e_vsi *vsi)\n \t\ti40e_configure_msi_and_legacy(vsi);\n \n \t/* start rings */\n-\terr = i40e_vsi_control_rings(vsi, true);\n+\terr = i40e_vsi_start_rings(vsi);\n \tif (err)\n \t\treturn err;\n \n@@ -5328,7 +5331,7 @@ void i40e_down(struct i40e_vsi *vsi)\n \t\tnetif_tx_disable(vsi->netdev);\n \t}\n \ti40e_vsi_disable_irq(vsi);\n-\ti40e_vsi_control_rings(vsi, false);\n+\ti40e_vsi_stop_rings(vsi);\n \ti40e_napi_disable_all(vsi);\n \n \tfor (i = 0; i < vsi->num_queue_pairs; i++) {\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex 69e184b..53b46553 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -991,7 +991,7 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)\n \tif (vf->lan_vsi_idx == 0)\n \t\tgoto complete_reset;\n \n-\ti40e_vsi_control_rings(pf->vsi[vf->lan_vsi_idx], false);\n+\ti40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]);\n complete_reset:\n \t/* reallocate VF resources to reset the VSI state */\n \ti40e_free_vf_res(vf);\n@@ -1032,8 +1032,7 @@ void i40e_free_vfs(struct i40e_pf *pf)\n \ti40e_notify_client_of_vf_enable(pf, 0);\n \tfor (i = 0; i < pf->num_alloc_vfs; i++)\n \t\tif (test_bit(I40E_VF_STAT_INIT, &pf->vf[i].vf_states))\n-\t\t\ti40e_vsi_control_rings(pf->vsi[pf->vf[i].lan_vsi_idx],\n-\t\t\t\t\t       false);\n+\t\t\ti40e_vsi_stop_rings(pf->vsi[pf->vf[i].lan_vsi_idx]);\n \n \t/* Disable IOV before freeing resources. This lets any VF drivers\n \t * running in the host get themselves cleaned up before we yank\n@@ -1759,7 +1758,7 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \t\tgoto error_param;\n \t}\n \n-\tif (i40e_vsi_control_rings(pf->vsi[vf->lan_vsi_idx], true))\n+\tif (i40e_vsi_start_rings(pf->vsi[vf->lan_vsi_idx]))\n \t\taq_ret = I40E_ERR_TIMEOUT;\n error_param:\n \t/* send the response to the VF */\n@@ -1798,8 +1797,7 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \t\tgoto error_param;\n \t}\n \n-\tif (i40e_vsi_control_rings(pf->vsi[vf->lan_vsi_idx], false))\n-\t\taq_ret = I40E_ERR_TIMEOUT;\n+\ti40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]);\n \n error_param:\n \t/* send the response to the VF */\n@@ -2139,9 +2137,8 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \t}\n \n \tfor (i = 0; i < vfl->num_elements; i++) {\n-\t\tint ret = i40e_vsi_kill_vlan(vsi, vfl->vlan_id[i]);\n-\t\tif (!ret)\n-\t\t\tvf->num_vlan--;\n+\t\ti40e_vsi_kill_vlan(vsi, vfl->vlan_id[i]);\n+\t\tvf->num_vlan--;\n \n \t\tif (test_bit(I40E_VF_STAT_UC_PROMISC, &vf->vf_states))\n \t\t\ti40e_aq_set_vsi_uc_promisc_on_vlan(&pf->hw, vsi->seid,\n@@ -2153,11 +2150,6 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \t\t\t\t\t\t\t   false,\n \t\t\t\t\t\t\t   vfl->vlan_id[i],\n \t\t\t\t\t\t\t   NULL);\n-\n-\t\tif (ret)\n-\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\"Unable to delete VLAN filter %d for VF %d, error %d\\n\",\n-\t\t\t\tvfl->vlan_id[i], vf->vf_id, ret);\n \t}\n \n error_param:\n@@ -2835,13 +2827,8 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id,\n \n \tif (vsi->info.pvid) {\n \t\t/* kill old VLAN */\n-\t\tret = i40e_vsi_kill_vlan(vsi, (le16_to_cpu(vsi->info.pvid) &\n-\t\t\t\t\t       VLAN_VID_MASK));\n-\t\tif (ret) {\n-\t\t\tdev_info(&vsi->back->pdev->dev,\n-\t\t\t\t \"remove VLAN failed, ret=%d, aq_err=%d\\n\",\n-\t\t\t\t ret, pf->hw.aq.asq_last_status);\n-\t\t}\n+\t\ti40e_vsi_kill_vlan(vsi, (le16_to_cpu(vsi->info.pvid) &\n+\t\t\t\t\t VLAN_VID_MASK));\n \t}\n \tif (vlan_id || qos)\n \t\tret = i40e_vsi_add_pvid(vsi, vlanprio);\n",
    "prefixes": [
        "next",
        "S50",
        "6/6"
    ]
}