Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/761841/?format=api
{ "id": 761841, "url": "http://patchwork.ozlabs.org/api/patches/761841/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170512183810.26185-3-anthony.l.nguyen@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": "<20170512183810.26185-3-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2017-05-12T18:38:09", "name": "[3/4] ixgbevf: Resolve truncation warning for q_vector->name", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "daa2b89649e8f52225475f55100becb611772551", "submitter": { "id": 68875, "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api", "name": "Tony Nguyen", "email": "anthony.l.nguyen@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/20170512183810.26185-3-anthony.l.nguyen@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/761841/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/761841/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" ], "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 3wPgTv41Cnz9s7B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 13 May 2017 05:46:59 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2317E976BE;\n\tFri, 12 May 2017 19:46:58 +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 hIWiqmhWFiIU; Fri, 12 May 2017 19:46:57 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 8C7E0976AE;\n\tFri, 12 May 2017 19:46:57 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id C97731C0ACA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 May 2017 19:46:53 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id BA08A92C2F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 May 2017 19:46:53 +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 C-SjnJPetB9y for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 May 2017 19:46:53 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 433C2926D1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 May 2017 19:46:53 +0000 (UTC)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 May 2017 12:46:53 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.152.64])\n\tby fmsmga005.fm.intel.com with ESMTP; 12 May 2017 12:46:53 -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.38,330,1491289200\"; d=\"scan'208\";a=\"100834275\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 12 May 2017 11:38:09 -0700", "Message-Id": "<20170512183810.26185-3-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.9.3", "In-Reply-To": "<20170512183810.26185-1-anthony.l.nguyen@intel.com>", "References": "<20170512183810.26185-1-anthony.l.nguyen@intel.com>", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH 3/4] ixgbevf: Resolve truncation warning\n\tfor q_vector->name", "X-BeenThere": "intel-wired-lan@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.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=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "intel-wired-lan-bounces@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "The following warning is now shown as a result of new checks added for\ngcc 7:\n\ndrivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function ‘ixgbevf_open’:\ndrivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1363:13: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size between 3 and 18 [-Wformat-truncation=]\n \"%s-%s-%d\", netdev->name, \"TxRx\", ri++);\n ^~\ndrivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1363:6: note: directive argument in the range [0, 2147483647]\n \"%s-%s-%d\", netdev->name, \"TxRx\", ri++);\n ^~~~~~~~~~\ndrivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:1362:4: note: ‘snprintf’ output between 8 and 32 bytes into a destination of size 24\n snprintf(q_vector->name, sizeof(q_vector->name) - 1,\n ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \"%s-%s-%d\", netdev->name, \"TxRx\", ri++);\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nResolve this warning by making a couple of changes.\n - Don't reserve space for the null terminator. Since snprintf adds the\n null terminator automatically, there is no need for us to reserve a byte\n for it.\n\n - Change a couple variables that can never be negative from int to\n unsigned int.\n\nWhile we're making changes to the format string, move the constant strings\ninto the format string instead of providing them as specifiers.\n\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\nindex 706d868..aced91c 100644\n--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c\n@@ -1351,23 +1351,23 @@ static int ixgbevf_request_msix_irqs(struct ixgbevf_adapter *adapter)\n {\n \tstruct net_device *netdev = adapter->netdev;\n \tint q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS;\n+\tunsigned int ri = 0, ti = 0;\n \tint vector, err;\n-\tint ri = 0, ti = 0;\n \n \tfor (vector = 0; vector < q_vectors; vector++) {\n \t\tstruct ixgbevf_q_vector *q_vector = adapter->q_vector[vector];\n \t\tstruct msix_entry *entry = &adapter->msix_entries[vector];\n \n \t\tif (q_vector->tx.ring && q_vector->rx.ring) {\n-\t\t\tsnprintf(q_vector->name, sizeof(q_vector->name) - 1,\n-\t\t\t\t \"%s-%s-%d\", netdev->name, \"TxRx\", ri++);\n+\t\t\tsnprintf(q_vector->name, sizeof(q_vector->name),\n+\t\t\t\t \"%s-TxRx-%u\", netdev->name, ri++);\n \t\t\tti++;\n \t\t} else if (q_vector->rx.ring) {\n-\t\t\tsnprintf(q_vector->name, sizeof(q_vector->name) - 1,\n-\t\t\t\t \"%s-%s-%d\", netdev->name, \"rx\", ri++);\n+\t\t\tsnprintf(q_vector->name, sizeof(q_vector->name),\n+\t\t\t\t \"%s-rx-%u\", netdev->name, ri++);\n \t\t} else if (q_vector->tx.ring) {\n-\t\t\tsnprintf(q_vector->name, sizeof(q_vector->name) - 1,\n-\t\t\t\t \"%s-%s-%d\", netdev->name, \"tx\", ti++);\n+\t\t\tsnprintf(q_vector->name, sizeof(q_vector->name),\n+\t\t\t\t \"%s-tx-%u\", netdev->name, ti++);\n \t\t} else {\n \t\t\t/* skip this unused q_vector */\n \t\t\tcontinue;\n", "prefixes": [ "3/4" ] }