Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1276674/?format=api
{ "id": 1276674, "url": "http://patchwork.ozlabs.org/api/patches/1276674/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200424201623.10971-18-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": "<20200424201623.10971-18-andre.guedes@intel.com>", "list_archive_url": null, "date": "2020-04-24T20:16:21", "name": "[17/19] igc: Change return type from igc_disable_nfc_rule()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "532a5722a3da0dc16c393775f88eed15f78b180f", "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/20200424201623.10971-18-andre.guedes@intel.com/mbox/", "series": [ { "id": 172579, "url": "http://patchwork.ozlabs.org/api/series/172579/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=172579", "date": "2020-04-24T20:16:07", "name": "igc: Fixes to NFC support code", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/172579/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1276674/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1276674/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 spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)", "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49857s34QZz9sSd\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2020 06:17:45 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C863587FD6;\n\tFri, 24 Apr 2020 20:17:43 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 3hMap4xRaMTZ; Fri, 24 Apr 2020 20:17:42 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 11F0387F92;\n\tFri, 24 Apr 2020 20:17:42 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by ash.osuosl.org (Postfix) with ESMTP id 8FE9F1BF83C\n for <intel-wired-lan@lists.osuosl.org>; Fri, 24 Apr 2020 20:17:33 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n by whitealder.osuosl.org (Postfix) with ESMTP id 8C8928803D\n for <intel-wired-lan@lists.osuosl.org>; Fri, 24 Apr 2020 20:17:33 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id VfyrXC6f3exc for <intel-wired-lan@lists.osuosl.org>;\n Fri, 24 Apr 2020 20:17:30 +0000 (UTC)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by whitealder.osuosl.org (Postfix) with ESMTPS id D80F188005\n for <intel-wired-lan@lists.osuosl.org>; Fri, 24 Apr 2020 20:17:29 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 24 Apr 2020 13:17:29 -0700", "from kleandre-mobl.amr.corp.intel.com ([10.213.164.39])\n by orsmga001.jf.intel.com with ESMTP; 24 Apr 2020 13:17:29 -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": [ "\n Wob5vgvSiFTwXSTkfJW6k1eXFGGvnM4kyo/z5Dx6XEnD1rOTsi2Bn6GpbzvbPD0cwwyDVA9i57\n qoGDKJbwd4rg==", "\n 66GEftB/VnoZWnfeceGq/fnhQ3Ds0RcTi7DvR+x0gDsW+JvCEoqWUzp047R3ZnCHddeKHDaiiC\n 1F7GKKOSm75g==" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.73,313,1583222400\"; d=\"scan'208\";a=\"335474525\"", "From": "Andre Guedes <andre.guedes@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 24 Apr 2020 13:16:21 -0700", "Message-Id": "<20200424201623.10971-18-andre.guedes@intel.com>", "X-Mailer": "git-send-email 2.26.0", "In-Reply-To": "<20200424201623.10971-1-andre.guedes@intel.com>", "References": "<20200424201623.10971-1-andre.guedes@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH 17/19] igc: Change return type from\n igc_disable_nfc_rule()", "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 <intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <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 <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": "None of igc_disable_nfc_rule() callers actually check its returning\nvalue. A closer look at why this function would fail shows that the\nonly situation is when we try to delete an ethertype or mac filter that\ndoesn't exist.\n\nThat situation is very unlikely so we can change igc_del_etype_filter()\nand igc_del_mac_filter() logic to \"if the filter doesn't exist, we are\ndone\", and keep the logic in igc_disable_nfc_rule() callers simple.\n\nSigned-off-by: Andre Guedes <andre.guedes@intel.com>\n---\n drivers/net/ethernet/intel/igc/igc_main.c | 26 ++++++++---------------\n 1 file changed, 9 insertions(+), 17 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c\nindex 64e372f38c6b..134523064fe9 100644\n--- a/drivers/net/ethernet/intel/igc/igc_main.c\n+++ b/drivers/net/ethernet/intel/igc/igc_main.c\n@@ -2260,18 +2260,16 @@ static int igc_add_mac_filter(struct igc_adapter *adapter,\n * @adapter: Pointer to adapter where the filter should be deleted from\n * @type: MAC address filter type (source or destination)\n * @addr: MAC address\n- *\n- * Return: 0 in case of success, negative errno code otherwise.\n */\n-static int igc_del_mac_filter(struct igc_adapter *adapter,\n-\t\t\t enum igc_mac_filter_type type, const u8 *addr)\n+static void igc_del_mac_filter(struct igc_adapter *adapter,\n+\t\t\t enum igc_mac_filter_type type, const u8 *addr)\n {\n \tstruct net_device *dev = adapter->netdev;\n \tint index;\n \n \tindex = igc_find_mac_filter(adapter, type, addr);\n \tif (index < 0)\n-\t\treturn -ENOENT;\n+\t\treturn;\n \n \tif (index == 0) {\n \t\t/* If this is the default filter, we don't actually delete it.\n@@ -2289,8 +2287,6 @@ static int igc_del_mac_filter(struct igc_adapter *adapter,\n \n \t\tigc_clear_mac_filter_hw(adapter, index);\n \t}\n-\n-\treturn 0;\n }\n \n /**\n@@ -2421,23 +2417,20 @@ static int igc_find_etype_filter(struct igc_adapter *adapter, u16 etype)\n * igc_del_etype_filter() - Delete ethertype filter.\n * @adapter: Pointer to adapter where the filter should be deleted from.\n * @etype: Ethertype value.\n- *\n- * Return: 0 in case of success, negative errno code otherwise.\n */\n-static int igc_del_etype_filter(struct igc_adapter *adapter, u16 etype)\n+static void igc_del_etype_filter(struct igc_adapter *adapter, u16 etype)\n {\n \tstruct igc_hw *hw = &adapter->hw;\n \tint index;\n \n \tindex = igc_find_etype_filter(adapter, etype);\n \tif (index < 0)\n-\t\treturn -ENOENT;\n+\t\treturn;\n \n \twr32(IGC_ETQF(index), 0);\n \n \tnetdev_dbg(adapter->netdev, \"Delete ethertype filter: etype %04x\",\n \t\t etype);\n-\treturn 0;\n }\n \n static int igc_enable_nfc_rule(struct igc_adapter *adapter,\n@@ -2478,8 +2471,8 @@ static int igc_enable_nfc_rule(struct igc_adapter *adapter,\n \treturn 0;\n }\n \n-static int igc_disable_nfc_rule(struct igc_adapter *adapter,\n-\t\t\t\tconst struct igc_nfc_rule *rule)\n+static void igc_disable_nfc_rule(struct igc_adapter *adapter,\n+\t\t\t\t const struct igc_nfc_rule *rule)\n {\n \tif (rule->filter.match_flags & IGC_FILTER_FLAG_ETHER_TYPE)\n \t\tigc_del_etype_filter(adapter, rule->filter.etype);\n@@ -2498,8 +2491,6 @@ static int igc_disable_nfc_rule(struct igc_adapter *adapter,\n \tif (rule->filter.match_flags & IGC_FILTER_FLAG_DST_MAC_ADDR)\n \t\tigc_del_mac_filter(adapter, IGC_MAC_FILTER_TYPE_DST,\n \t\t\t\t rule->filter.dst_addr);\n-\n-\treturn 0;\n }\n \n /**\n@@ -2624,7 +2615,8 @@ static int igc_uc_unsync(struct net_device *netdev, const unsigned char *addr)\n {\n \tstruct igc_adapter *adapter = netdev_priv(netdev);\n \n-\treturn igc_del_mac_filter(adapter, IGC_MAC_FILTER_TYPE_DST, addr);\n+\tigc_del_mac_filter(adapter, IGC_MAC_FILTER_TYPE_DST, addr);\n+\treturn 0;\n }\n \n /**\n", "prefixes": [ "17/19" ] }