Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/512056/?format=api
{ "id": 512056, "url": "http://patchwork.ozlabs.org/api/patches/512056/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1440798961-17326-9-git-send-email-catherine.sullivan@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": "<1440798961-17326-9-git-send-email-catherine.sullivan@intel.com>", "list_archive_url": null, "date": "2015-08-28T21:55:54", "name": "[next,S13,08/15] i40e/i40evf: clean up some code", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "b3546712aa25b731148ce4e6d0445ea709603154", "submitter": { "id": 13931, "url": "http://patchwork.ozlabs.org/api/people/13931/?format=api", "name": "Catherine Sullivan", "email": "catherine.sullivan@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/1440798961-17326-9-git-send-email-catherine.sullivan@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/512056/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/512056/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ozlabs.org (Postfix) with ESMTP id BA34C14031B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 29 Aug 2015 07:55:21 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 0FA228B978;\n\tFri, 28 Aug 2015 21:55:21 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id kAPOeWNJRh8D; Fri, 28 Aug 2015 21:55:18 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 2C0198B97E;\n\tFri, 28 Aug 2015 21:55:18 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3BC001CEB0B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 28 Aug 2015 21:55:11 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 37E4A95EBB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 28 Aug 2015 21:55: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 mgnw7TFrGXQJ for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 28 Aug 2015 21:55:08 +0000 (UTC)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 718DF95ED9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 28 Aug 2015 21:55:07 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP; 28 Aug 2015 14:55:07 -0700", "from catheri1-tigger.jf.intel.com ([134.134.176.92])\n\tby orsmga003.jf.intel.com with ESMTP; 28 Aug 2015 14:55:05 -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.17,427,1437462000\"; d=\"scan'208\";a=\"634260301\"", "From": "Catherine Sullivan <catherine.sullivan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 28 Aug 2015 17:55:54 -0400", "Message-Id": "<1440798961-17326-9-git-send-email-catherine.sullivan@intel.com>", "X-Mailer": "git-send-email 1.9.3", "In-Reply-To": "<1440798961-17326-1-git-send-email-catherine.sullivan@intel.com>", "References": "<1440798961-17326-1-git-send-email-catherine.sullivan@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S13 08/15] i40e/i40evf: clean up some\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: Jesse Brandeburg <jesse.brandeburg@intel.com>\n\nAdd missings spaces after declarations, remove another __func__ use,\nremove uncessary braces, remove unneeded breaks, and useless returns,\nand generally fix up some code.\n\nSigned-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>\nSigned-off-by: Shannon Nelson <shannon.nelson@intel.com>\nChange-ID: Ie715d6b64976c50e1c21531685fe0a2bd38c4244\n---\n drivers/net/ethernet/intel/i40e/i40e_adminq.c | 3 +-\n drivers/net/ethernet/intel/i40e/i40e_common.c | 9 +-\n drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | 1 +\n drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 124 ++++++++++++---------\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 +-\n drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 1 -\n drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c | 3 +-\n drivers/net/ethernet/intel/i40e/i40e_main.c | 39 ++++---\n drivers/net/ethernet/intel/i40e/i40e_ptp.c | 3 +-\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 6 +-\n drivers/net/ethernet/intel/i40e/i40e_txrx.h | 1 +\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 13 ++-\n drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 3 +-\n drivers/net/ethernet/intel/i40evf/i40e_common.c | 8 +-\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 6 +-\n drivers/net/ethernet/intel/i40evf/i40e_txrx.h | 1 +\n drivers/net/ethernet/intel/i40evf/i40evf.h | 4 -\n 17 files changed, 125 insertions(+), 103 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c\nindex 3e1f0b2..bfe8979 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c\n@@ -681,8 +681,7 @@ static u16 i40e_clean_asq(struct i40e_hw *hw)\n \tdetails = I40E_ADMINQ_DETAILS(*asq, ntc);\n \twhile (rd32(hw, hw->aq.asq.head) != ntc) {\n \t\ti40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,\n-\t\t\t \"%s: ntc %d head %d.\\n\", __func__, ntc,\n-\t\t\t rd32(hw, hw->aq.asq.head));\n+\t\t\t \"ntc %d head %d.\\n\", ntc, rd32(hw, hw->aq.asq.head));\n \n \t\tif (details->callback) {\n \t\t\tI40E_ADMINQ_CALLBACK cb_func =\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c\nindex 2839ea5..2d012d9 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_common.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c\n@@ -1035,7 +1035,7 @@ i40e_status i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr)\n \tstatus = i40e_aq_mac_address_read(hw, &flags, &addrs, NULL);\n \n \tif (flags & I40E_AQC_LAN_ADDR_VALID)\n-\t\tmemcpy(mac_addr, &addrs.pf_lan_mac, sizeof(addrs.pf_lan_mac));\n+\t\tether_addr_copy(mac_addr, addrs.pf_lan_mac);\n \n \treturn status;\n }\n@@ -1058,7 +1058,7 @@ i40e_status i40e_get_port_mac_addr(struct i40e_hw *hw, u8 *mac_addr)\n \t\treturn status;\n \n \tif (flags & I40E_AQC_PORT_ADDR_VALID)\n-\t\tmemcpy(mac_addr, &addrs.port_mac, sizeof(addrs.port_mac));\n+\t\tether_addr_copy(mac_addr, addrs.port_mac);\n \telse\n \t\tstatus = I40E_ERR_INVALID_MAC_ADDR;\n \n@@ -1116,7 +1116,7 @@ i40e_status i40e_get_san_mac_addr(struct i40e_hw *hw, u8 *mac_addr)\n \t\treturn status;\n \n \tif (flags & I40E_AQC_SAN_ADDR_VALID)\n-\t\tmemcpy(mac_addr, &addrs.pf_san_mac, sizeof(addrs.pf_san_mac));\n+\t\tether_addr_copy(mac_addr, addrs.pf_san_mac);\n \telse\n \t\tstatus = I40E_ERR_INVALID_MAC_ADDR;\n \n@@ -2363,6 +2363,7 @@ i40e_status i40e_aq_get_veb_parameters(struct i40e_hw *hw,\n \t\t*vebs_free = le16_to_cpu(cmd_resp->vebs_free);\n \tif (floating) {\n \t\tu16 flags = le16_to_cpu(cmd_resp->veb_flags);\n+\n \t\tif (flags & I40E_AQC_ADD_VEB_FLOATING)\n \t\t\t*floating = true;\n \t\telse\n@@ -3777,7 +3778,7 @@ i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,\n \t}\n \n \tif (mac_addr)\n-\t\tmemcpy(cmd->mac, mac_addr, ETH_ALEN);\n+\t\tether_addr_copy(cmd->mac, mac_addr);\n \n \tcmd->etype = cpu_to_le16(ethtype);\n \tcmd->flags = cpu_to_le16(flags);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c\nindex dbadad7..7c42d13 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c\n@@ -236,6 +236,7 @@ static void i40e_dcbnl_del_app(struct i40e_pf *pf,\n \t\t\t struct i40e_dcb_app_priority_table *app)\n {\n \tint v, err;\n+\n \tfor (v = 0; v < pf->num_alloc_vsi; v++) {\n \t\tif (pf->vsi[v] && pf->vsi[v]->netdev) {\n \t\t\terr = i40e_dcbnl_vsi_del_app(pf->vsi[v], app);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\nindex 1556c4e..e19d479 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n@@ -404,82 +404,82 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)\n \tnstat = i40e_get_vsi_stats_struct(vsi);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\\n\",\n-\t\t (long unsigned int)nstat->rx_packets,\n-\t\t (long unsigned int)nstat->rx_bytes,\n-\t\t (long unsigned int)nstat->rx_errors,\n-\t\t (long unsigned int)nstat->rx_dropped);\n+\t\t (unsigned long int)nstat->rx_packets,\n+\t\t (unsigned long int)nstat->rx_bytes,\n+\t\t (unsigned long int)nstat->rx_errors,\n+\t\t (unsigned long int)nstat->rx_dropped);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\\n\",\n-\t\t (long unsigned int)nstat->tx_packets,\n-\t\t (long unsigned int)nstat->tx_bytes,\n-\t\t (long unsigned int)nstat->tx_errors,\n-\t\t (long unsigned int)nstat->tx_dropped);\n+\t\t (unsigned long int)nstat->tx_packets,\n+\t\t (unsigned long int)nstat->tx_bytes,\n+\t\t (unsigned long int)nstat->tx_errors,\n+\t\t (unsigned long int)nstat->tx_dropped);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats: multicast = %lu, collisions = %lu\\n\",\n-\t\t (long unsigned int)nstat->multicast,\n-\t\t (long unsigned int)nstat->collisions);\n+\t\t (unsigned long int)nstat->multicast,\n+\t\t (unsigned long int)nstat->collisions);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\\n\",\n-\t\t (long unsigned int)nstat->rx_length_errors,\n-\t\t (long unsigned int)nstat->rx_over_errors,\n-\t\t (long unsigned int)nstat->rx_crc_errors);\n+\t\t (unsigned long int)nstat->rx_length_errors,\n+\t\t (unsigned long int)nstat->rx_over_errors,\n+\t\t (unsigned long int)nstat->rx_crc_errors);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\\n\",\n-\t\t (long unsigned int)nstat->rx_frame_errors,\n-\t\t (long unsigned int)nstat->rx_fifo_errors,\n-\t\t (long unsigned int)nstat->rx_missed_errors);\n+\t\t (unsigned long int)nstat->rx_frame_errors,\n+\t\t (unsigned long int)nstat->rx_fifo_errors,\n+\t\t (unsigned long int)nstat->rx_missed_errors);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\\n\",\n-\t\t (long unsigned int)nstat->tx_aborted_errors,\n-\t\t (long unsigned int)nstat->tx_carrier_errors,\n-\t\t (long unsigned int)nstat->tx_fifo_errors);\n+\t\t (unsigned long int)nstat->tx_aborted_errors,\n+\t\t (unsigned long int)nstat->tx_carrier_errors,\n+\t\t (unsigned long int)nstat->tx_fifo_errors);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats: tx_heartbeat_errors = %lu, tx_window_errors = %lu\\n\",\n-\t\t (long unsigned int)nstat->tx_heartbeat_errors,\n-\t\t (long unsigned int)nstat->tx_window_errors);\n+\t\t (unsigned long int)nstat->tx_heartbeat_errors,\n+\t\t (unsigned long int)nstat->tx_window_errors);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats: rx_compressed = %lu, tx_compressed = %lu\\n\",\n-\t\t (long unsigned int)nstat->rx_compressed,\n-\t\t (long unsigned int)nstat->tx_compressed);\n+\t\t (unsigned long int)nstat->rx_compressed,\n+\t\t (unsigned long int)nstat->tx_compressed);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats_offsets: rx_packets = %lu, rx_bytes = %lu, rx_errors = %lu, rx_dropped = %lu\\n\",\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_packets,\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_bytes,\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_errors,\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_dropped);\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_packets,\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_bytes,\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_errors,\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_dropped);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats_offsets: tx_packets = %lu, tx_bytes = %lu, tx_errors = %lu, tx_dropped = %lu\\n\",\n-\t\t (long unsigned int)vsi->net_stats_offsets.tx_packets,\n-\t\t (long unsigned int)vsi->net_stats_offsets.tx_bytes,\n-\t\t (long unsigned int)vsi->net_stats_offsets.tx_errors,\n-\t\t (long unsigned int)vsi->net_stats_offsets.tx_dropped);\n+\t\t (unsigned long int)vsi->net_stats_offsets.tx_packets,\n+\t\t (unsigned long int)vsi->net_stats_offsets.tx_bytes,\n+\t\t (unsigned long int)vsi->net_stats_offsets.tx_errors,\n+\t\t (unsigned long int)vsi->net_stats_offsets.tx_dropped);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats_offsets: multicast = %lu, collisions = %lu\\n\",\n-\t\t (long unsigned int)vsi->net_stats_offsets.multicast,\n-\t\t (long unsigned int)vsi->net_stats_offsets.collisions);\n+\t\t (unsigned long int)vsi->net_stats_offsets.multicast,\n+\t\t (unsigned long int)vsi->net_stats_offsets.collisions);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats_offsets: rx_length_errors = %lu, rx_over_errors = %lu, rx_crc_errors = %lu\\n\",\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_length_errors,\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_over_errors,\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_crc_errors);\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_length_errors,\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_over_errors,\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_crc_errors);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats_offsets: rx_frame_errors = %lu, rx_fifo_errors = %lu, rx_missed_errors = %lu\\n\",\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_frame_errors,\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_fifo_errors,\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_missed_errors);\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_frame_errors,\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_fifo_errors,\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_missed_errors);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats_offsets: tx_aborted_errors = %lu, tx_carrier_errors = %lu, tx_fifo_errors = %lu\\n\",\n-\t\t (long unsigned int)vsi->net_stats_offsets.tx_aborted_errors,\n-\t\t (long unsigned int)vsi->net_stats_offsets.tx_carrier_errors,\n-\t\t (long unsigned int)vsi->net_stats_offsets.tx_fifo_errors);\n+\t\t (unsigned long int)vsi->net_stats_offsets.tx_aborted_errors,\n+\t\t (unsigned long int)vsi->net_stats_offsets.tx_carrier_errors,\n+\t\t (unsigned long int)vsi->net_stats_offsets.tx_fifo_errors);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats_offsets: tx_heartbeat_errors = %lu, tx_window_errors = %lu\\n\",\n-\t\t (long unsigned int)vsi->net_stats_offsets.tx_heartbeat_errors,\n-\t\t (long unsigned int)vsi->net_stats_offsets.tx_window_errors);\n+\t\t (unsigned long int)vsi->net_stats_offsets.tx_heartbeat_errors,\n+\t\t (unsigned long int)vsi->net_stats_offsets.tx_window_errors);\n \tdev_info(&pf->pdev->dev,\n \t\t \" net_stats_offsets: rx_compressed = %lu, tx_compressed = %lu\\n\",\n-\t\t (long unsigned int)vsi->net_stats_offsets.rx_compressed,\n-\t\t (long unsigned int)vsi->net_stats_offsets.tx_compressed);\n+\t\t (unsigned long int)vsi->net_stats_offsets.rx_compressed,\n+\t\t (unsigned long int)vsi->net_stats_offsets.tx_compressed);\n \tdev_info(&pf->pdev->dev,\n \t\t \" tx_restart = %d, tx_busy = %d, rx_buf_failed = %d, rx_page_failed = %d\\n\",\n \t\t vsi->tx_restart, vsi->tx_busy,\n@@ -487,6 +487,7 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)\n \trcu_read_lock();\n \tfor (i = 0; i < vsi->num_queue_pairs; i++) {\n \t\tstruct i40e_ring *rx_ring = ACCESS_ONCE(vsi->rx_rings[i]);\n+\n \t\tif (!rx_ring)\n \t\t\tcontinue;\n \n@@ -527,7 +528,7 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)\n \t\tdev_info(&pf->pdev->dev,\n \t\t\t \" rx_rings[%i]: size = %i, dma = 0x%08lx\\n\",\n \t\t\t i, rx_ring->size,\n-\t\t\t (long unsigned int)rx_ring->dma);\n+\t\t\t (unsigned long int)rx_ring->dma);\n \t\tdev_info(&pf->pdev->dev,\n \t\t\t \" rx_rings[%i]: vsi = %p, q_vector = %p\\n\",\n \t\t\t i, rx_ring->vsi,\n@@ -535,6 +536,7 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)\n \t}\n \tfor (i = 0; i < vsi->num_queue_pairs; i++) {\n \t\tstruct i40e_ring *tx_ring = ACCESS_ONCE(vsi->tx_rings[i]);\n+\n \t\tif (!tx_ring)\n \t\t\tcontinue;\n \n@@ -573,7 +575,7 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)\n \t\tdev_info(&pf->pdev->dev,\n \t\t\t \" tx_rings[%i]: size = %i, dma = 0x%08lx\\n\",\n \t\t\t i, tx_ring->size,\n-\t\t\t (long unsigned int)tx_ring->dma);\n+\t\t\t (unsigned long int)tx_ring->dma);\n \t\tdev_info(&pf->pdev->dev,\n \t\t\t \" tx_rings[%i]: vsi = %p, q_vector = %p\\n\",\n \t\t\t i, tx_ring->vsi,\n@@ -743,6 +745,7 @@ static void i40e_dbg_dump_aq_desc(struct i40e_pf *pf)\n \tring = &(hw->aq.asq);\n \tfor (i = 0; i < ring->count; i++) {\n \t\tstruct i40e_aq_desc *d = I40E_ADMINQ_DESC(*ring, i);\n+\n \t\tdev_info(&pf->pdev->dev,\n \t\t\t \" at[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\\n\",\n \t\t\t i, d->flags, d->opcode, d->datalen, d->retval,\n@@ -755,6 +758,7 @@ static void i40e_dbg_dump_aq_desc(struct i40e_pf *pf)\n \tring = &(hw->aq.arq);\n \tfor (i = 0; i < ring->count; i++) {\n \t\tstruct i40e_aq_desc *d = I40E_ADMINQ_DESC(*ring, i);\n+\n \t\tdev_info(&pf->pdev->dev,\n \t\t\t \" ar[%02d] flags=0x%04x op=0x%04x dlen=0x%04x ret=0x%04x cookie_h=0x%08x cookie_l=0x%08x\\n\",\n \t\t\t i, d->flags, d->opcode, d->datalen, d->retval,\n@@ -1038,7 +1042,13 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t\tdev_info(&pf->pdev->dev, \"'%s' failed\\n\", cmd_buf);\n \n \t} else if (strncmp(cmd_buf, \"del vsi\", 7) == 0) {\n-\t\tsscanf(&cmd_buf[7], \"%i\", &vsi_seid);\n+\t\tcnt = sscanf(&cmd_buf[7], \"%i\", &vsi_seid);\n+\t\tif (cnt != 1) {\n+\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t \"del vsi: bad command string, cnt=%d\\n\",\n+\t\t\t\t cnt);\n+\t\t\tgoto command_write_done;\n+\t\t}\n \t\tvsi = i40e_dbg_find_vsi(pf, vsi_seid);\n \t\tif (!vsi) {\n \t\t\tdev_info(&pf->pdev->dev, \"del VSI %d: seid not found\\n\",\n@@ -1488,6 +1498,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t} else if (strncmp(cmd_buf, \"read\", 4) == 0) {\n \t\tu32 address;\n \t\tu32 value;\n+\n \t\tcnt = sscanf(&cmd_buf[4], \"%i\", &address);\n \t\tif (cnt != 1) {\n \t\t\tdev_info(&pf->pdev->dev, \"read <reg>\\n\");\n@@ -1507,6 +1518,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \n \t} else if (strncmp(cmd_buf, \"write\", 5) == 0) {\n \t\tu32 address, value;\n+\n \t\tcnt = sscanf(&cmd_buf[5], \"%i %i\", &address, &value);\n \t\tif (cnt != 2) {\n \t\t\tdev_info(&pf->pdev->dev, \"write <reg> <value>\\n\");\n@@ -1528,6 +1540,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t\tcnt = sscanf(&cmd_buf[15], \"%i\", &vsi_seid);\n \t\t\tif (cnt == 0) {\n \t\t\t\tint i;\n+\n \t\t\t\tfor (i = 0; i < pf->num_alloc_vsi; i++)\n \t\t\t\t\ti40e_vsi_reset_stats(pf->vsi[i]);\n \t\t\t\tdev_info(&pf->pdev->dev, \"vsi clear stats called for all vsi's\\n\");\n@@ -1726,8 +1739,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t\t\t packet_len, I40E_FDIR_MAX_RAW_PACKET_SIZE);\n \n \t\tfor (i = 0; i < packet_len; i++) {\n-\t\t\tsscanf(&asc_packet[j], \"%2hhx \",\n-\t\t\t &raw_packet[i]);\n+\t\t\tcnt = sscanf(&asc_packet[j], \"%2hhx \", &raw_packet[i]);\n+\t\t\tif (!cnt)\n+\t\t\t\tbreak;\n \t\t\tj += 3;\n \t\t}\n \t\tdev_info(&pf->pdev->dev, \"FD raw packet dump\\n\");\n@@ -1755,6 +1769,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t} else if (strncmp(cmd_buf, \"lldp\", 4) == 0) {\n \t\tif (strncmp(&cmd_buf[5], \"stop\", 4) == 0) {\n \t\t\tint ret;\n+\n \t\t\tret = i40e_aq_stop_lldp(&pf->hw, false, NULL);\n \t\t\tif (ret) {\n \t\t\t\tdev_info(&pf->pdev->dev,\n@@ -1779,6 +1794,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n #endif /* CONFIG_I40E_DCB */\n \t\t} else if (strncmp(&cmd_buf[5], \"start\", 5) == 0) {\n \t\t\tint ret;\n+\n \t\t\tret = i40e_aq_add_rem_control_packet_filter(&pf->hw,\n \t\t\t\t\t\tpf->hw.mac.addr,\n \t\t\t\t\t\tI40E_ETH_P_LLDP, 0,\n@@ -1807,6 +1823,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t\tu16 llen, rlen;\n \t\t\tint ret;\n \t\t\tu8 *buff;\n+\n \t\t\tbuff = kzalloc(I40E_LLDPDU_SIZE, GFP_KERNEL);\n \t\t\tif (!buff)\n \t\t\t\tgoto command_write_done;\n@@ -1833,6 +1850,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t\tu16 llen, rlen;\n \t\t\tint ret;\n \t\t\tu8 *buff;\n+\n \t\t\tbuff = kzalloc(I40E_LLDPDU_SIZE, GFP_KERNEL);\n \t\t\tif (!buff)\n \t\t\t\tgoto command_write_done;\n@@ -1858,6 +1876,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t\tbuff = NULL;\n \t\t} else if (strncmp(&cmd_buf[5], \"event on\", 8) == 0) {\n \t\t\tint ret;\n+\n \t\t\tret = i40e_aq_cfg_lldp_mib_change_event(&pf->hw,\n \t\t\t\t\t\t\t\ttrue, NULL);\n \t\t\tif (ret) {\n@@ -1868,6 +1887,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,\n \t\t\t}\n \t\t} else if (strncmp(&cmd_buf[5], \"event off\", 9) == 0) {\n \t\t\tint ret;\n+\n \t\t\tret = i40e_aq_cfg_lldp_mib_change_event(&pf->hw,\n \t\t\t\t\t\t\t\tfalse, NULL);\n \t\t\tif (ret) {\n@@ -2105,6 +2125,7 @@ static ssize_t i40e_dbg_netdev_ops_write(struct file *filp,\n \t\t}\n \t} else if (strncmp(i40e_dbg_netdev_ops_buf, \"change_mtu\", 10) == 0) {\n \t\tint mtu;\n+\n \t\tcnt = sscanf(&i40e_dbg_netdev_ops_buf[11], \"%i %i\",\n \t\t\t &vsi_seid, &mtu);\n \t\tif (cnt != 2) {\n@@ -2220,7 +2241,6 @@ void i40e_dbg_pf_init(struct i40e_pf *pf)\n create_failed:\n \tdev_info(dev, \"debugfs dir/file for %s failed\\n\", name);\n \tdebugfs_remove_recursive(pf->i40e_dbg_pf);\n-\treturn;\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 5a726f2..148f614 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -1360,6 +1360,7 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,\n \tif ((pf->lan_veb != I40E_NO_VEB) &&\n \t (pf->flags & I40E_FLAG_VEB_STATS_ENABLED)) {\n \t\tstruct i40e_veb *veb = pf->veb[pf->lan_veb];\n+\n \t\tfor (j = 0; j < I40E_VEB_STATS_LEN; j++) {\n \t\t\tp = (char *)veb;\n \t\t\tp += i40e_gstrings_veb_stats[j].stat_offset;\n@@ -1607,7 +1608,7 @@ static inline bool i40e_active_vfs(struct i40e_pf *pf)\n \tint i;\n \n \tfor (i = 0; i < pf->num_alloc_vfs; i++)\n-\t\tif (vfs[i].vf_states & I40E_VF_STAT_ACTIVE)\n+\t\tif (test_bit(I40E_VF_STAT_ACTIVE, &vfs[i].vf_states))\n \t\t\treturn true;\n \treturn false;\n }\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c\nindex 2398d9b..eaedc1f 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c\n@@ -324,7 +324,6 @@ void i40e_init_pf_fcoe(struct i40e_pf *pf)\n \twr32(hw, I40E_GLFCOE_RCTL, val);\n \n \tdev_info(&pf->pdev->dev, \"FCoE is supported.\\n\");\n-\treturn;\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c\nindex fa371a2..79ae7be 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_lan_hmc.c\n@@ -431,9 +431,8 @@ exit_sd_error:\n \t\t\tpd_idx1 = max(pd_idx,\n \t\t\t\t ((j - 1) * I40E_HMC_MAX_BP_COUNT));\n \t\t\tpd_lmt1 = min(pd_lmt, (j * I40E_HMC_MAX_BP_COUNT));\n-\t\t\tfor (i = pd_idx1; i < pd_lmt1; i++) {\n+\t\t\tfor (i = pd_idx1; i < pd_lmt1; i++)\n \t\t\t\ti40e_remove_pd_bp(hw, info->hmc_info, i);\n-\t\t\t}\n \t\t\ti40e_remove_pd_page(hw, info->hmc_info, (j - 1));\n \t\t\tbreak;\n \t\tcase I40E_SD_TYPE_DIRECT:\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 2ea4cdd..87ad491 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -216,10 +216,10 @@ static int i40e_get_lump(struct i40e_pf *pf, struct i40e_lump_tracking *pile,\n \t\t\tret = i;\n \t\t\tpile->search_hint = i + j;\n \t\t\tbreak;\n-\t\t} else {\n-\t\t\t/* not enough, so skip over it and continue looking */\n-\t\t\ti += j;\n \t\t}\n+\n+\t\t/* not enough, so skip over it and continue looking */\n+\t\ti += j;\n \t}\n \n \treturn ret;\n@@ -460,11 +460,11 @@ void i40e_vsi_reset_stats(struct i40e_vsi *vsi)\n \tmemset(&vsi->eth_stats_offsets, 0, sizeof(vsi->eth_stats_offsets));\n \tif (vsi->rx_rings && vsi->rx_rings[0]) {\n \t\tfor (i = 0; i < vsi->num_queue_pairs; i++) {\n-\t\t\tmemset(&vsi->rx_rings[i]->stats, 0 ,\n+\t\t\tmemset(&vsi->rx_rings[i]->stats, 0,\n \t\t\t sizeof(vsi->rx_rings[i]->stats));\n-\t\t\tmemset(&vsi->rx_rings[i]->rx_stats, 0 ,\n+\t\t\tmemset(&vsi->rx_rings[i]->rx_stats, 0,\n \t\t\t sizeof(vsi->rx_rings[i]->rx_stats));\n-\t\t\tmemset(&vsi->tx_rings[i]->stats, 0 ,\n+\t\t\tmemset(&vsi->tx_rings[i]->stats, 0,\n \t\t\t sizeof(vsi->tx_rings[i]->stats));\n \t\t\tmemset(&vsi->tx_rings[i]->tx_stats, 0,\n \t\t\t sizeof(vsi->tx_rings[i]->tx_stats));\n@@ -782,6 +782,7 @@ static void i40e_update_link_xoff_rx(struct i40e_pf *pf)\n \n \t\tfor (i = 0; i < vsi->num_queue_pairs; i++) {\n \t\t\tstruct i40e_ring *ring = vsi->tx_rings[i];\n+\n \t\t\tclear_bit(__I40E_HANG_CHECK_ARMED, &ring->state);\n \t\t}\n \t}\n@@ -813,6 +814,7 @@ static void i40e_update_prio_xoff_rx(struct i40e_pf *pf)\n \n \tfor (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {\n \t\tu64 prio_xoff = nsd->priority_xoff_rx[i];\n+\n \t\ti40e_stat_update32(hw, I40E_GLPRT_PXOFFRXC(hw->port, i),\n \t\t\t\t pf->stat_offsets_loaded,\n \t\t\t\t &osd->priority_xoff_rx[i],\n@@ -1426,6 +1428,7 @@ void i40e_del_filter(struct i40e_vsi *vsi,\n \t} else {\n \t\t/* make sure we don't remove a filter in use by VF or netdev */\n \t\tint min_f = 0;\n+\n \t\tmin_f += (f->is_vf ? 1 : 0);\n \t\tmin_f += (f->is_netdev ? 1 : 0);\n \n@@ -1484,6 +1487,7 @@ static int i40e_set_mac(struct net_device *netdev, void *p)\n \n \tif (vsi->type == I40E_VSI_MAIN) {\n \t\ti40e_status ret;\n+\n \t\tret = i40e_aq_mac_address_write(&vsi->back->hw,\n \t\t\t\t\t\tI40E_AQC_WRITE_TYPE_LAA_WOL,\n \t\t\t\t\t\taddr->sa_data, NULL);\n@@ -1918,6 +1922,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t/* check for changes in promiscuous modes */\n \tif (changed_flags & IFF_ALLMULTI) {\n \t\tbool cur_multipromisc;\n+\n \t\tcur_multipromisc = !!(vsi->current_netdev_flags & IFF_ALLMULTI);\n \t\tret = i40e_aq_set_vsi_multicast_promiscuous(&vsi->back->hw,\n \t\t\t\t\t\t\t vsi->seid,\n@@ -1932,6 +1937,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t}\n \tif ((changed_flags & IFF_PROMISC) || promisc_forced_on) {\n \t\tbool cur_promisc;\n+\n \t\tcur_promisc = (!!(vsi->current_netdev_flags & IFF_PROMISC) ||\n \t\t\t test_bit(__I40E_FILTER_OVERFLOW_PROMISC,\n \t\t\t\t\t&vsi->state));\n@@ -3222,6 +3228,7 @@ static irqreturn_t i40e_intr(int irq, void *data)\n \n \t\t/* temporarily disable queue cause for NAPI processing */\n \t\tu32 qval = rd32(hw, I40E_QINT_RQCTL(0));\n+\n \t\tqval &= ~I40E_QINT_RQCTL_CAUSE_ENA_MASK;\n \t\twr32(hw, I40E_QINT_RQCTL(0), qval);\n \n@@ -3391,9 +3398,9 @@ static bool i40e_clean_fdir_tx_irq(struct i40e_ring *tx_ring, int budget)\n \ti += tx_ring->count;\n \ttx_ring->next_to_clean = i;\n \n-\tif (vsi->back->flags & I40E_FLAG_MSIX_ENABLED) {\n+\tif (vsi->back->flags & I40E_FLAG_MSIX_ENABLED)\n \t\ti40e_irq_dynamic_enable(vsi, tx_ring->q_vector->v_idx);\n-\t}\n+\n \treturn budget > 0;\n }\n \n@@ -3996,11 +4003,10 @@ static void i40e_quiesce_vsi(struct i40e_vsi *vsi)\n \t}\n \n \tset_bit(__I40E_NEEDS_RESTART, &vsi->state);\n-\tif (vsi->netdev && netif_running(vsi->netdev)) {\n+\tif (vsi->netdev && netif_running(vsi->netdev))\n \t\tvsi->netdev->netdev_ops->ndo_stop(vsi->netdev);\n-\t} else {\n+\telse\n \t\ti40e_vsi_close(vsi);\n-\t}\n }\n \n /**\n@@ -5173,15 +5179,13 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)\n \t\t\t \"VSI reinit requested\\n\");\n \t\tfor (v = 0; v < pf->num_alloc_vsi; v++) {\n \t\t\tstruct i40e_vsi *vsi = pf->vsi[v];\n+\n \t\t\tif (vsi != NULL &&\n \t\t\t test_bit(__I40E_REINIT_REQUESTED, &vsi->state)) {\n \t\t\t\ti40e_vsi_reinit_locked(pf->vsi[v]);\n \t\t\t\tclear_bit(__I40E_REINIT_REQUESTED, &vsi->state);\n \t\t\t}\n \t\t}\n-\n-\t\t/* no further action needed, so return now */\n-\t\treturn;\n \t} else if (reset_flags & BIT_ULL(__I40E_DOWN_REQUESTED)) {\n \t\tint v;\n \n@@ -5189,6 +5193,7 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)\n \t\tdev_info(&pf->pdev->dev, \"VSI down requested\\n\");\n \t\tfor (v = 0; v < pf->num_alloc_vsi; v++) {\n \t\t\tstruct i40e_vsi *vsi = pf->vsi[v];\n+\n \t\t\tif (vsi != NULL &&\n \t\t\t test_bit(__I40E_DOWN_REQUESTED, &vsi->state)) {\n \t\t\t\tset_bit(__I40E_DOWN, &vsi->state);\n@@ -5196,13 +5201,9 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)\n \t\t\t\tclear_bit(__I40E_DOWN_REQUESTED, &vsi->state);\n \t\t\t}\n \t\t}\n-\n-\t\t/* no further action needed, so return now */\n-\t\treturn;\n \t} else {\n \t\tdev_info(&pf->pdev->dev,\n \t\t\t \"bad reset request 0x%08x\\n\", reset_flags);\n-\t\treturn;\n \t}\n }\n \n@@ -6209,6 +6210,7 @@ static int i40e_reconstitute_veb(struct i40e_veb *veb)\n \n \t\tif (pf->vsi[v]->veb_idx == veb->idx) {\n \t\t\tstruct i40e_vsi *vsi = pf->vsi[v];\n+\n \t\t\tvsi->uplink_seid = veb->seid;\n \t\t\tret = i40e_add_vsi(vsi);\n \t\t\tif (ret) {\n@@ -9699,6 +9701,7 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit)\n \t} else {\n \t\t/* force a reset of TC and queue layout configurations */\n \t\tu8 enabled_tc = pf->vsi[pf->lan_vsi]->tc_config.enabled_tc;\n+\n \t\tpf->vsi[pf->lan_vsi]->tc_config.enabled_tc = 0;\n \t\tpf->vsi[pf->lan_vsi]->seid = pf->main_vsi_seid;\n \t\ti40e_vsi_config_tc(pf->vsi[pf->lan_vsi], enabled_tc);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c\nindex 8c40d6e..552c84e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c\n@@ -618,9 +618,8 @@ static long i40e_ptp_create_clock(struct i40e_pf *pf)\n \n \t/* Attempt to register the clock before enabling the hardware. */\n \tpf->ptp_clock = ptp_clock_register(&pf->ptp_caps, &pf->pdev->dev);\n-\tif (IS_ERR(pf->ptp_clock)) {\n+\tif (IS_ERR(pf->ptp_clock))\n \t\treturn PTR_ERR(pf->ptp_clock);\n-\t}\n \n \t/* clear the hwtstamp settings here during clock create, instead of\n \t * during regular init, so that we can maintain settings across a\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 4232217..2144f58 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -1599,6 +1599,7 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, int budget)\n \t\tcleaned_count++;\n \t\tif (rx_hbo || rx_sph) {\n \t\t\tint len;\n+\n \t\t\tif (rx_hbo)\n \t\t\t\tlen = I40E_RX_HDR_SIZE;\n \t\t\telse\n@@ -1784,9 +1785,6 @@ static int i40e_clean_rx_irq_1buf(struct i40e_ring *rx_ring, int budget)\n \t\t/* ERR_MASK will only have valid bits if EOP set */\n \t\tif (unlikely(rx_error & BIT(I40E_RX_DESC_ERROR_RXE_SHIFT))) {\n \t\t\tdev_kfree_skb_any(skb);\n-\t\t\t/* TODO: shouldn't we increment a counter indicating the\n-\t\t\t * drop?\n-\t\t\t */\n \t\t\tcontinue;\n \t\t}\n \n@@ -2158,6 +2156,7 @@ static inline int i40e_tx_prepare_vlan_flags(struct sk_buff *skb,\n \t/* else if it is a SW VLAN, check the next protocol and store the tag */\n \t} else if (protocol == htons(ETH_P_8021Q)) {\n \t\tstruct vlan_hdr *vhdr, _vhdr;\n+\n \t\tvhdr = skb_header_pointer(skb, ETH_HLEN, sizeof(_vhdr), &_vhdr);\n \t\tif (!vhdr)\n \t\t\treturn -EINVAL;\n@@ -2778,6 +2777,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \tu8 hdr_len = 0;\n \tint tsyn;\n \tint tso;\n+\n \tif (0 == i40e_xmit_descriptor_count(skb, tx_ring))\n \t\treturn NETDEV_TX_BUSY;\n \ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\nindex c6d2995..12612ee 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n@@ -165,6 +165,7 @@ struct i40e_tx_buffer {\n \t};\n \tunsigned int bytecount;\n \tunsigned short gso_segs;\n+\n \tDEFINE_DMA_UNMAP_ADDR(dma);\n \tDEFINE_DMA_UNMAP_LEN(len);\n \tu32 tx_flags;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex aa4e44c..f42c7c1 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -536,6 +536,7 @@ static int i40e_alloc_vsi_res(struct i40e_vf *vf, enum i40e_vsi_type type)\n \t}\n \tif (type == I40E_VSI_SRIOV) {\n \t\tu8 brdcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};\n+\n \t\tvf->lan_vsi_idx = vsi->idx;\n \t\tvf->lan_vsi_id = vsi->id;\n \t\t/* If the port VLAN has been configured and then the\n@@ -605,6 +606,7 @@ static void i40e_enable_vf_mappings(struct i40e_vf *vf)\n \t/* map PF queues to VF queues */\n \tfor (j = 0; j < pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs; j++) {\n \t\tu16 qid = i40e_vc_get_pf_queue_id(vf, vf->lan_vsi_id, j);\n+\n \t\treg = (qid & I40E_VPLAN_QTABLE_QINDEX_MASK);\n \t\twr32(hw, I40E_VPLAN_QTABLE(total_queue_pairs, vf->vf_id), reg);\n \t\ttotal_queue_pairs++;\n@@ -991,7 +993,7 @@ static int i40e_pci_sriov_enable(struct pci_dev *pdev, int num_vfs)\n \tint pre_existing_vfs = pci_num_vf(pdev);\n \tint err = 0;\n \n-\tif (pf->state & __I40E_TESTING) {\n+\tif (test_bit(__I40E_TESTING, &pf->state)) {\n \t\tdev_warn(&pdev->dev,\n \t\t\t \"Cannot enable SR-IOV virtual functions while the device is undergoing diagnostic testing\\n\");\n \t\terr = -EPERM;\n@@ -1210,8 +1212,8 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)\n \t\tvfres->vsi_res[i].vsi_type = I40E_VSI_SRIOV;\n \t\tvfres->vsi_res[i].num_queue_pairs =\n \t\t pf->vsi[vf->lan_vsi_idx]->alloc_queue_pairs;\n-\t\tmemcpy(vfres->vsi_res[i].default_mac_addr,\n-\t\t vf->default_lan_addr.addr, ETH_ALEN);\n+\t\tether_addr_copy(vfres->vsi_res[i].default_mac_addr,\n+\t\t\t\tvf->default_lan_addr.addr);\n \t\ti++;\n \t}\n \tset_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states);\n@@ -1715,6 +1717,7 @@ static int i40e_vc_add_vlan_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \tfor (i = 0; i < vfl->num_elements; i++) {\n \t\t/* add new VLAN filter */\n \t\tint ret = i40e_vsi_add_vlan(vsi, vfl->vlan_id[i]);\n+\n \t\tif (ret)\n \t\t\tdev_err(&pf->pdev->dev,\n \t\t\t\t\"Unable to add VF vlan filter %d, error %d\\n\",\n@@ -1766,6 +1769,7 @@ static int i40e_vc_remove_vlan_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)\n \n \tfor (i = 0; i < vfl->num_elements; i++) {\n \t\tint ret = i40e_vsi_kill_vlan(vsi, vfl->vlan_id[i]);\n+\n \t\tif (ret)\n \t\t\tdev_err(&pf->pdev->dev,\n \t\t\t\t\"Unable to delete VF vlan filter %d, error %d\\n\",\n@@ -1877,7 +1881,6 @@ static int i40e_vc_validate_vf_msg(struct i40e_vf *vf, u32 v_opcode,\n \tcase I40E_VIRTCHNL_OP_UNKNOWN:\n \tdefault:\n \t\treturn -EPERM;\n-\t\tbreak;\n \t}\n \t/* few more checks */\n \tif ((valid_len != msglen) || (err_msg_format)) {\n@@ -2316,7 +2319,7 @@ int i40e_ndo_get_vf_config(struct net_device *netdev,\n \n \tivi->vf = vf_id;\n \n-\tmemcpy(&ivi->mac, vf->default_lan_addr.addr, ETH_ALEN);\n+\tether_addr_copy(ivi->mac, vf->default_lan_addr.addr);\n \n \tivi->max_tx_rate = vf->tx_rate;\n \tivi->min_tx_rate = 0;\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c\nindex cb21e01..7b5993b 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c\n@@ -620,8 +620,7 @@ static u16 i40e_clean_asq(struct i40e_hw *hw)\n \tdetails = I40E_ADMINQ_DETAILS(*asq, ntc);\n \twhile (rd32(hw, hw->aq.asq.head) != ntc) {\n \t\ti40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,\n-\t\t\t \"%s: ntc %d head %d.\\n\", __func__, ntc,\n-\t\t\t rd32(hw, hw->aq.asq.head));\n+\t\t\t \"ntc %d head %d.\\n\", ntc, rd32(hw, hw->aq.asq.head));\n \n \t\tif (details->callback) {\n \t\t\tI40E_ADMINQ_CALLBACK cb_func =\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_common.c b/drivers/net/ethernet/intel/i40evf/i40e_common.c\nindex 96e48ee..b98b642 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_common.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_common.c\n@@ -992,10 +992,10 @@ void i40e_vf_parse_hw_config(struct i40e_hw *hw,\n \t\t\t I40E_VIRTCHNL_VF_OFFLOAD_FCOE) ? 1 : 0;\n \tfor (i = 0; i < msg->num_vsis; i++) {\n \t\tif (vsi_res->vsi_type == I40E_VSI_SRIOV) {\n-\t\t\tmemcpy(hw->mac.perm_addr, vsi_res->default_mac_addr,\n-\t\t\t ETH_ALEN);\n-\t\t\tmemcpy(hw->mac.addr, vsi_res->default_mac_addr,\n-\t\t\t ETH_ALEN);\n+\t\t\tether_addr_copy(hw->mac.perm_addr,\n+\t\t\t\t\tvsi_res->default_mac_addr);\n+\t\t\tether_addr_copy(hw->mac.addr,\n+\t\t\t\t\tvsi_res->default_mac_addr);\n \t\t}\n \t\tvsi_res++;\n \t}\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex 1d0e38f..45260c2 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -1065,6 +1065,7 @@ static int i40e_clean_rx_irq_ps(struct i40e_ring *rx_ring, int budget)\n \t\tcleaned_count++;\n \t\tif (rx_hbo || rx_sph) {\n \t\t\tint len;\n+\n \t\t\tif (rx_hbo)\n \t\t\t\tlen = I40E_RX_HDR_SIZE;\n \t\t\telse\n@@ -1238,9 +1239,6 @@ static int i40e_clean_rx_irq_1buf(struct i40e_ring *rx_ring, int budget)\n \t\t/* ERR_MASK will only have valid bits if EOP set */\n \t\tif (unlikely(rx_error & BIT(I40E_RX_DESC_ERROR_RXE_SHIFT))) {\n \t\t\tdev_kfree_skb_any(skb);\n-\t\t\t/* TODO: shouldn't we increment a counter indicating the\n-\t\t\t * drop?\n-\t\t\t */\n \t\t\tcontinue;\n \t\t}\n \n@@ -1436,6 +1434,7 @@ static inline int i40evf_tx_prepare_vlan_flags(struct sk_buff *skb,\n \t/* else if it is a SW VLAN, check the next protocol and store the tag */\n \t} else if (protocol == htons(ETH_P_8021Q)) {\n \t\tstruct vlan_hdr *vhdr, _vhdr;\n+\n \t\tvhdr = skb_header_pointer(skb, ETH_HLEN, sizeof(_vhdr), &_vhdr);\n \t\tif (!vhdr)\n \t\t\treturn -EINVAL;\n@@ -1978,6 +1977,7 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,\n \tu32 td_cmd = 0;\n \tu8 hdr_len = 0;\n \tint tso;\n+\n \tif (0 == i40evf_xmit_descriptor_count(skb, tx_ring))\n \t\treturn NETDEV_TX_BUSY;\n \ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\nindex e8dd651..26fc85f 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.h\n@@ -164,6 +164,7 @@ struct i40e_tx_buffer {\n \t};\n \tunsigned int bytecount;\n \tunsigned short gso_segs;\n+\n \tDEFINE_DMA_UNMAP_ADDR(dma);\n \tDEFINE_DMA_UNMAP_LEN(len);\n \tu32 tx_flags;\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h\nindex 3817cbb..27dc3fe 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h\n@@ -48,10 +48,6 @@\n \n #define DEFAULT_DEBUG_LEVEL_SHIFT 3\n #define PFX \"i40evf: \"\n-#define DPRINTK(nlevel, klevel, fmt, args...) \\\n-\t((void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \\\n-\tprintk(KERN_##klevel PFX \"%s: %s: \" fmt, adapter->netdev->name, \\\n-\t\t__func__ , ## args)))\n \n /* dummy struct to make common code less painful */\n struct i40e_vsi {\n", "prefixes": [ "next", "S13", "08/15" ] }