Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1261080/?format=api
{ "id": 1261080, "url": "http://patchwork.ozlabs.org/api/patches/1261080/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200325003824.5487-2-andre.guedes@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": "<20200325003824.5487-2-andre.guedes@intel.com>", "list_archive_url": null, "date": "2020-03-25T00:38:15", "name": "[01/10] igc: Use netdev log helpers in igc_main.c", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d5e34ebdae0aad135b7fc8790336568959f4c858", "submitter": { "id": 72323, "url": "http://patchwork.ozlabs.org/api/people/72323/?format=api", "name": "Andre Guedes", "email": "andre.guedes@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/20200325003824.5487-2-andre.guedes@intel.com/mbox/", "series": [ { "id": 166478, "url": "http://patchwork.ozlabs.org/api/series/166478/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=166478", "date": "2020-03-25T00:38:14", "name": "igc: Align log messages", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/166478/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1261080/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1261080/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; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.137;\n\thelo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 48n8PH0RGfz9sR4\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 25 Mar 2020 11:38:43 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 821D7868E1;\n\tWed, 25 Mar 2020 00:38:41 +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 UoVmkbVFBfgK; Wed, 25 Mar 2020 00:38:40 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id F33578687B;\n\tWed, 25 Mar 2020 00:38:39 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5A5F31BF9B4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 25 Mar 2020 00:38:37 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 26CDF20341\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 25 Mar 2020 00:38:37 +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 u5zymGH1abtt for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 25 Mar 2020 00:38:34 +0000 (UTC)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 53BC123A53\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 25 Mar 2020 00:38:34 +0000 (UTC)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; \n\t24 Mar 2020 17:38:34 -0700", "from johnorte-mobl2.amr.corp.intel.com ([10.251.10.249])\n\tby fmsmga006.fm.intel.com with ESMTP; 24 Mar 2020 17:38:33 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "IronPort-SDR": [ "vnMjy4d0BedlwjUUvmrCubD6V5dJOnwJYte7KThjvrlTtcQqs1LujH4mxxpZ62sqIEAgcSsQkH\n\tQXI2wGudPO+w==", "4SXWG6lbRJm/QsuCL6/IbJCqUjT/YO4FjaQndNMzP7CUynXh8YZSSp3neKrkQQWI4Y/2JMzsEE\n\t6S08GrNK04vQ==" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.72,302,1580803200\"; d=\"scan'208\";a=\"448099338\"", "From": "Andre Guedes <andre.guedes@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 24 Mar 2020 17:38:15 -0700", "Message-Id": "<20200325003824.5487-2-andre.guedes@intel.com>", "X-Mailer": "git-send-email 2.25.0", "In-Reply-To": "<20200325003824.5487-1-andre.guedes@intel.com>", "References": "<20200325003824.5487-1-andre.guedes@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH 01/10] igc: Use netdev log helpers in\n\tigc_main.c", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.29", "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>", "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": "In igc_main.c we print log messages using both dev_* and netdev_*\nhelpers, generating inconsistent output. Since this is a network device\ndriver, we should preferably use netdev_* helpers because they append\nthe interface name to the message, helping making sense out of the logs.\n\nThis patch converts all dev_* calls to netdev_*. There is only two\nexceptions: one in igc_probe (net_device has not been allocated yet),\nand another one in igc_init_module (module initialization). It also\ntakes this opportunity to improve some messages and remove the '\\n'\ncharacter at the end of messages since it is automatically added to by\nnetdev_* log helpers.\n\nSigned-off-by: Andre Guedes <andre.guedes@intel.com>\n---\n drivers/net/ethernet/intel/igc/igc_main.c | 129 ++++++++++------------\n 1 file changed, 59 insertions(+), 70 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c\nindex a605a02c0479..c3555148ca0e 100644\n--- a/drivers/net/ethernet/intel/igc/igc_main.c\n+++ b/drivers/net/ethernet/intel/igc/igc_main.c\n@@ -76,7 +76,7 @@ static void igc_power_down_link(struct igc_adapter *adapter)\n \n void igc_reset(struct igc_adapter *adapter)\n {\n-\tstruct pci_dev *pdev = adapter->pdev;\n+\tstruct net_device *dev = adapter->netdev;\n \tstruct igc_hw *hw = &adapter->hw;\n \tstruct igc_fc_info *fc = &hw->fc;\n \tu32 pba, hwm;\n@@ -103,7 +103,7 @@ void igc_reset(struct igc_adapter *adapter)\n \thw->mac.ops.reset_hw(hw);\n \n \tif (hw->mac.ops.init_hw(hw))\n-\t\tdev_err(&pdev->dev, \"Hardware Error\\n\");\n+\t\tnetdev_err(dev, \"Error on hardware initialization\");\n \n \tif (!netif_running(adapter->netdev))\n \t\tigc_power_down_link(adapter);\n@@ -288,6 +288,7 @@ static void igc_clean_all_tx_rings(struct igc_adapter *adapter)\n */\n int igc_setup_tx_resources(struct igc_ring *tx_ring)\n {\n+\tstruct net_device *ndev = tx_ring->netdev;\n \tstruct device *dev = tx_ring->dev;\n \tint size = 0;\n \n@@ -313,8 +314,7 @@ int igc_setup_tx_resources(struct igc_ring *tx_ring)\n \n err:\n \tvfree(tx_ring->tx_buffer_info);\n-\tdev_err(dev,\n-\t\t\"Unable to allocate memory for the transmit descriptor ring\\n\");\n+\tnetdev_err(ndev, \"Unable to allocate memory for tx descriptor ring\");\n \treturn -ENOMEM;\n }\n \n@@ -326,14 +326,13 @@ int igc_setup_tx_resources(struct igc_ring *tx_ring)\n */\n static int igc_setup_all_tx_resources(struct igc_adapter *adapter)\n {\n-\tstruct pci_dev *pdev = adapter->pdev;\n+\tstruct net_device *dev = adapter->netdev;\n \tint i, err = 0;\n \n \tfor (i = 0; i < adapter->num_tx_queues; i++) {\n \t\terr = igc_setup_tx_resources(adapter->tx_ring[i]);\n \t\tif (err) {\n-\t\t\tdev_err(&pdev->dev,\n-\t\t\t\t\"Allocation for Tx Queue %u failed\\n\", i);\n+\t\t\tnetdev_err(dev, \"Error on tx queue %u setup\", i);\n \t\t\tfor (i--; i >= 0; i--)\n \t\t\t\tigc_free_tx_resources(adapter->tx_ring[i]);\n \t\t\tbreak;\n@@ -444,6 +443,7 @@ static void igc_free_all_rx_resources(struct igc_adapter *adapter)\n */\n int igc_setup_rx_resources(struct igc_ring *rx_ring)\n {\n+\tstruct net_device *ndev = rx_ring->netdev;\n \tstruct device *dev = rx_ring->dev;\n \tint size, desc_len;\n \n@@ -473,8 +473,7 @@ int igc_setup_rx_resources(struct igc_ring *rx_ring)\n err:\n \tvfree(rx_ring->rx_buffer_info);\n \trx_ring->rx_buffer_info = NULL;\n-\tdev_err(dev,\n-\t\t\"Unable to allocate memory for the receive descriptor ring\\n\");\n+\tnetdev_err(ndev, \"Unable to allocate memory for rx descriptor ring\");\n \treturn -ENOMEM;\n }\n \n@@ -487,14 +486,13 @@ int igc_setup_rx_resources(struct igc_ring *rx_ring)\n */\n static int igc_setup_all_rx_resources(struct igc_adapter *adapter)\n {\n-\tstruct pci_dev *pdev = adapter->pdev;\n+\tstruct net_device *dev = adapter->netdev;\n \tint i, err = 0;\n \n \tfor (i = 0; i < adapter->num_rx_queues; i++) {\n \t\terr = igc_setup_rx_resources(adapter->rx_ring[i]);\n \t\tif (err) {\n-\t\t\tdev_err(&pdev->dev,\n-\t\t\t\t\"Allocation for Rx Queue %u failed\\n\", i);\n+\t\t\tnetdev_err(dev, \"Error on rx queue %u setup\", i);\n \t\t\tfor (i--; i >= 0; i--)\n \t\t\t\tigc_free_rx_resources(adapter->rx_ring[i]);\n \t\t\tbreak;\n@@ -1196,7 +1194,7 @@ static int igc_tx_map(struct igc_ring *tx_ring,\n \n \treturn 0;\n dma_error:\n-\tdev_err(tx_ring->dev, \"TX DMA map failed\\n\");\n+\tnetdev_err(tx_ring->netdev, \"TX DMA map failed\");\n \ttx_buffer = &tx_ring->tx_buffer_info[i];\n \n \t/* clear dma mappings for failed tx_buffer_info map */\n@@ -1460,8 +1458,8 @@ static void igc_rx_checksum(struct igc_ring *ring,\n \t\t\t\t IGC_RXD_STAT_UDPCS))\n \t\tskb->ip_summed = CHECKSUM_UNNECESSARY;\n \n-\tdev_dbg(ring->dev, \"cksum success: bits %08X\\n\",\n-\t\tle32_to_cpu(rx_desc->wb.upper.status_error));\n+\tnetdev_dbg(ring->netdev, \"cksum success: bits %08X\",\n+\t\t le32_to_cpu(rx_desc->wb.upper.status_error));\n }\n \n static inline void igc_rx_hash(struct igc_ring *ring,\n@@ -2123,27 +2121,27 @@ static bool igc_clean_tx_irq(struct igc_q_vector *q_vector, int napi_budget)\n \t\t (adapter->tx_timeout_factor * HZ)) &&\n \t\t !(rd32(IGC_STATUS) & IGC_STATUS_TXOFF)) {\n \t\t\t/* detected Tx unit hang */\n-\t\t\tdev_err(tx_ring->dev,\n-\t\t\t\t\"Detected Tx Unit Hang\\n\"\n-\t\t\t\t\" Tx Queue <%d>\\n\"\n-\t\t\t\t\" TDH <%x>\\n\"\n-\t\t\t\t\" TDT <%x>\\n\"\n-\t\t\t\t\" next_to_use <%x>\\n\"\n-\t\t\t\t\" next_to_clean <%x>\\n\"\n-\t\t\t\t\"buffer_info[next_to_clean]\\n\"\n-\t\t\t\t\" time_stamp <%lx>\\n\"\n-\t\t\t\t\" next_to_watch <%p>\\n\"\n-\t\t\t\t\" jiffies <%lx>\\n\"\n-\t\t\t\t\" desc.status <%x>\\n\",\n-\t\t\t\ttx_ring->queue_index,\n-\t\t\t\trd32(IGC_TDH(tx_ring->reg_idx)),\n-\t\t\t\treadl(tx_ring->tail),\n-\t\t\t\ttx_ring->next_to_use,\n-\t\t\t\ttx_ring->next_to_clean,\n-\t\t\t\ttx_buffer->time_stamp,\n-\t\t\t\ttx_buffer->next_to_watch,\n-\t\t\t\tjiffies,\n-\t\t\t\ttx_buffer->next_to_watch->wb.status);\n+\t\t\tnetdev_err(tx_ring->netdev,\n+\t\t\t\t \"Detected Tx Unit Hang\\n\"\n+\t\t\t\t \" Tx Queue <%d>\\n\"\n+\t\t\t\t \" TDH <%x>\\n\"\n+\t\t\t\t \" TDT <%x>\\n\"\n+\t\t\t\t \" next_to_use <%x>\\n\"\n+\t\t\t\t \" next_to_clean <%x>\\n\"\n+\t\t\t\t \"buffer_info[next_to_clean]\\n\"\n+\t\t\t\t \" time_stamp <%lx>\\n\"\n+\t\t\t\t \" next_to_watch <%p>\\n\"\n+\t\t\t\t \" jiffies <%lx>\\n\"\n+\t\t\t\t \" desc.status <%x>\\n\",\n+\t\t\t\t tx_ring->queue_index,\n+\t\t\t\t rd32(IGC_TDH(tx_ring->reg_idx)),\n+\t\t\t\t readl(tx_ring->tail),\n+\t\t\t\t tx_ring->next_to_use,\n+\t\t\t\t tx_ring->next_to_clean,\n+\t\t\t\t tx_buffer->time_stamp,\n+\t\t\t\t tx_buffer->next_to_watch,\n+\t\t\t\t jiffies,\n+\t\t\t\t tx_buffer->next_to_watch->wb.status);\n \t\t\tnetif_stop_subqueue(tx_ring->netdev,\n \t\t\t\t\t tx_ring->queue_index);\n \n@@ -3239,14 +3237,14 @@ static int igc_alloc_q_vectors(struct igc_adapter *adapter)\n */\n static int igc_init_interrupt_scheme(struct igc_adapter *adapter, bool msix)\n {\n-\tstruct pci_dev *pdev = adapter->pdev;\n+\tstruct net_device *dev = adapter->netdev;\n \tint err = 0;\n \n \tigc_set_interrupt_capability(adapter, msix);\n \n \terr = igc_alloc_q_vectors(adapter);\n \tif (err) {\n-\t\tdev_err(&pdev->dev, \"Unable to allocate memory for vectors\\n\");\n+\t\tnetdev_err(dev, \"Unable to allocate memory for vectors\");\n \t\tgoto err_alloc_q_vectors;\n \t}\n \n@@ -3306,7 +3304,7 @@ static int igc_sw_init(struct igc_adapter *adapter)\n \n \t/* This call may decrease the number of queues */\n \tif (igc_init_interrupt_scheme(adapter, true)) {\n-\t\tdev_err(&pdev->dev, \"Unable to allocate memory for queues\\n\");\n+\t\tnetdev_err(netdev, \"Unable to allocate memory for queues\");\n \t\treturn -ENOMEM;\n \t}\n \n@@ -3620,7 +3618,7 @@ static void igc_reset_task(struct work_struct *work)\n \n \tigc_rings_dump(adapter);\n \tigc_regs_dump(adapter);\n-\tnetdev_err(adapter->netdev, \"Reset adapter\\n\");\n+\tnetdev_err(adapter->netdev, \"Reset adapter\");\n \tigc_reinit_locked(adapter);\n }\n \n@@ -3649,8 +3647,7 @@ static int igc_change_mtu(struct net_device *netdev, int new_mtu)\n \tif (netif_running(netdev))\n \t\tigc_down(adapter);\n \n-\tnetdev_dbg(netdev, \"changing MTU from %d to %d\\n\",\n-\t\t netdev->mtu, new_mtu);\n+\tnetdev_dbg(netdev, \"changing MTU from %d to %d\", netdev->mtu, new_mtu);\n \tnetdev->mtu = new_mtu;\n \n \tif (netif_running(netdev))\n@@ -4009,8 +4006,7 @@ static void igc_watchdog_task(struct work_struct *work)\n \t\t\tctrl = rd32(IGC_CTRL);\n \t\t\t/* Link status message must follow this format */\n \t\t\tnetdev_info(netdev,\n-\t\t\t\t \"igc: %s NIC Link is Up %d Mbps %s Duplex, Flow Control: %s\\n\",\n-\t\t\t\t netdev->name,\n+\t\t\t\t \"NIC Link is Up %d Mbps %s Duplex, Flow Control: %s\",\n \t\t\t\t adapter->link_speed,\n \t\t\t\t adapter->link_duplex == FULL_DUPLEX ?\n \t\t\t\t \"Full\" : \"Half\",\n@@ -4022,7 +4018,7 @@ static void igc_watchdog_task(struct work_struct *work)\n \t\t\t/* check if SmartSpeed worked */\n \t\t\tigc_check_downshift(hw);\n \t\t\tif (phy->speed_downgraded)\n-\t\t\t\tnetdev_warn(netdev, \"Link Speed was downgraded by SmartSpeed\\n\");\n+\t\t\t\tnetdev_warn(netdev, \"Link Speed was downgraded by SmartSpeed\");\n \n \t\t\t/* adjust timeout factor according to speed/duplex */\n \t\t\tadapter->tx_timeout_factor = 1;\n@@ -4048,10 +4044,10 @@ static void igc_watchdog_task(struct work_struct *work)\n \t\t\t\t\tretry_count--;\n \t\t\t\t\tgoto retry_read_status;\n \t\t\t\t} else if (!retry_count) {\n-\t\t\t\t\tdev_err(&adapter->pdev->dev, \"exceed max 2 second\\n\");\n+\t\t\t\t\tnetdev_err(netdev, \"exceed max 2 second\");\n \t\t\t\t}\n \t\t\t} else {\n-\t\t\t\tdev_err(&adapter->pdev->dev, \"read 1000Base-T Status Reg\\n\");\n+\t\t\t\tnetdev_err(netdev, \"read 1000Base-T Status Reg\");\n \t\t\t}\n no_wait:\n \t\t\tnetif_carrier_on(netdev);\n@@ -4067,8 +4063,7 @@ static void igc_watchdog_task(struct work_struct *work)\n \t\t\tadapter->link_duplex = 0;\n \n \t\t\t/* Links status message must follow this format */\n-\t\t\tnetdev_info(netdev, \"igc: %s NIC Link is Down\\n\",\n-\t\t\t\t netdev->name);\n+\t\t\tnetdev_info(netdev, \"NIC Link is Down\");\n \t\t\tnetif_carrier_off(netdev);\n \n \t\t\t/* link state has changed, schedule phy info update */\n@@ -4286,8 +4281,7 @@ static int igc_request_irq(struct igc_adapter *adapter)\n \t\t\t netdev->name, adapter);\n \n \tif (err)\n-\t\tdev_err(&pdev->dev, \"Error %d getting interrupt\\n\",\n-\t\t\terr);\n+\t\tnetdev_err(netdev, \"Error %d getting interrupt\", err);\n \n request_done:\n \treturn err;\n@@ -4679,7 +4673,7 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg)\n \n \t\thw->hw_addr = NULL;\n \t\tnetif_device_detach(netdev);\n-\t\tnetdev_err(netdev, \"PCIe link lost, device now detached\\n\");\n+\t\tnetdev_err(netdev, \"PCIe link lost, device now detached\");\n \t\tWARN(pci_device_is_present(igc->pdev),\n \t\t \"igc: Failed to read reg 0x%x!\\n\", reg);\n \t}\n@@ -4689,7 +4683,6 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg)\n \n int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx)\n {\n-\tstruct pci_dev *pdev = adapter->pdev;\n \tstruct igc_mac_info *mac = &adapter->hw.mac;\n \n \tmac->autoneg = 0;\n@@ -4734,7 +4727,7 @@ int igc_set_spd_dplx(struct igc_adapter *adapter, u32 spd, u8 dplx)\n \treturn 0;\n \n err_inval:\n-\tdev_err(&pdev->dev, \"Unsupported Speed/Duplex configuration\\n\");\n+\tnetdev_err(adapter->netdev, \"Unsupported Speed/Duplex configuration\");\n \treturn -EINVAL;\n }\n \n@@ -4770,7 +4763,7 @@ static int igc_probe(struct pci_dev *pdev,\n \t\terr = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));\n \t\tif (err) {\n \t\t\tdev_err(&pdev->dev,\n-\t\t\t\t\"No usable DMA configuration, aborting\\n\");\n+\t\t\t\t\"No usable DMA configuration, aborting\");\n \t\t\tgoto err_dma;\n \t\t}\n \t}\n@@ -4881,8 +4874,7 @@ static int igc_probe(struct pci_dev *pdev,\n \n \tif (igc_get_flash_presence_i225(hw)) {\n \t\tif (hw->nvm.ops.validate(hw) < 0) {\n-\t\t\tdev_err(&pdev->dev,\n-\t\t\t\t\"The NVM Checksum Is Not Valid\\n\");\n+\t\t\tnetdev_err(netdev, \"The NVM Checksum Is Not Valid\");\n \t\t\terr = -EIO;\n \t\t\tgoto err_eeprom;\n \t\t}\n@@ -4891,13 +4883,13 @@ static int igc_probe(struct pci_dev *pdev,\n \tif (eth_platform_get_mac_address(&pdev->dev, hw->mac.addr)) {\n \t\t/* copy the MAC address out of the NVM */\n \t\tif (hw->mac.ops.read_mac_addr(hw))\n-\t\t\tdev_err(&pdev->dev, \"NVM Read Error\\n\");\n+\t\t\tnetdev_err(netdev, \"NVM Read Error\");\n \t}\n \n \tmemcpy(netdev->dev_addr, hw->mac.addr, netdev->addr_len);\n \n \tif (!is_valid_ether_addr(netdev->dev_addr)) {\n-\t\tdev_err(&pdev->dev, \"Invalid MAC Address\\n\");\n+\t\tnetdev_err(netdev, \"Invalid MAC Address\");\n \t\terr = -EIO;\n \t\tgoto err_eeprom;\n \t}\n@@ -4954,7 +4946,7 @@ static int igc_probe(struct pci_dev *pdev,\n \n \t/* print pcie link status and MAC address */\n \tpcie_print_link_status(pdev);\n-\tnetdev_info(netdev, \"MAC: %pM\\n\", netdev->dev_addr);\n+\tnetdev_info(netdev, \"MAC: %pM\", netdev->dev_addr);\n \n \tdev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_NEVER_SKIP);\n \n@@ -5145,8 +5137,7 @@ static int __maybe_unused igc_resume(struct device *dev)\n \t\treturn -ENODEV;\n \terr = pci_enable_device_mem(pdev);\n \tif (err) {\n-\t\tdev_err(&pdev->dev,\n-\t\t\t\"igc: Cannot enable PCI device from suspend\\n\");\n+\t\tnetdev_err(netdev, \"Cannot enable PCI device from suspend\");\n \t\treturn err;\n \t}\n \tpci_set_master(pdev);\n@@ -5155,7 +5146,7 @@ static int __maybe_unused igc_resume(struct device *dev)\n \tpci_enable_wake(pdev, PCI_D3cold, 0);\n \n \tif (igc_init_interrupt_scheme(adapter, true)) {\n-\t\tdev_err(&pdev->dev, \"Unable to allocate memory for queues\\n\");\n+\t\tnetdev_err(netdev, \"Unable to allocate memory for queues\");\n \t\treturn -ENOMEM;\n \t}\n \n@@ -5259,8 +5250,7 @@ static pci_ers_result_t igc_io_slot_reset(struct pci_dev *pdev)\n \tpci_ers_result_t result;\n \n \tif (pci_enable_device_mem(pdev)) {\n-\t\tdev_err(&pdev->dev,\n-\t\t\t\"Could not re-enable PCI device after reset.\\n\");\n+\t\tnetdev_err(netdev, \"Could not re-enable PCI device after reset\");\n \t\tresult = PCI_ERS_RESULT_DISCONNECT;\n \t} else {\n \t\tpci_set_master(pdev);\n@@ -5299,7 +5289,7 @@ static void igc_io_resume(struct pci_dev *pdev)\n \trtnl_lock();\n \tif (netif_running(netdev)) {\n \t\tif (igc_open(netdev)) {\n-\t\t\tdev_err(&pdev->dev, \"igc_open failed after reset\\n\");\n+\t\t\tnetdev_err(netdev, \"igc_open failed after reset\");\n \t\t\treturn;\n \t\t}\n \t}\n@@ -5346,7 +5336,6 @@ static struct pci_driver igc_driver = {\n int igc_reinit_queues(struct igc_adapter *adapter)\n {\n \tstruct net_device *netdev = adapter->netdev;\n-\tstruct pci_dev *pdev = adapter->pdev;\n \tint err = 0;\n \n \tif (netif_running(netdev))\n@@ -5355,7 +5344,7 @@ int igc_reinit_queues(struct igc_adapter *adapter)\n \tigc_reset_interrupt_capability(adapter);\n \n \tif (igc_init_interrupt_scheme(adapter, true)) {\n-\t\tdev_err(&pdev->dev, \"Unable to allocate memory for queues\\n\");\n+\t\tnetdev_err(netdev, \"Unable to allocate memory for queues\");\n \t\treturn -ENOMEM;\n \t}\n \n@@ -5388,10 +5377,10 @@ static int __init igc_init_module(void)\n {\n \tint ret;\n \n-\tpr_info(\"%s - version %s\\n\",\n+\tpr_info(\"%s - version %s\",\n \t\tigc_driver_string, igc_driver_version);\n \n-\tpr_info(\"%s\\n\", igc_copyright);\n+\tpr_info(\"%s\", igc_copyright);\n \n \tret = pci_register_driver(&igc_driver);\n \treturn ret;\n", "prefixes": [ "01/10" ] }