Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/761839/?format=api
{ "id": 761839, "url": "http://patchwork.ozlabs.org/api/patches/761839/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170512183810.26185-1-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-1-anthony.l.nguyen@intel.com>", "list_archive_url": null, "date": "2017-05-12T18:38:07", "name": "[1/4] ixgbe: Resolve truncation warning for q_vector->name", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "64e55d1764a52310ed0370b7a34a0e13e988b7a8", "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-1-anthony.l.nguyen@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/761839/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/761839/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 3wPgTp0gbkz9s7B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 13 May 2017 05:46:53 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 57ECB976B0;\n\tFri, 12 May 2017 19:46:52 +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 JUQPJia7CeBt; Fri, 12 May 2017 19:46:51 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id C3EA3976AA;\n\tFri, 12 May 2017 19:46:51 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8AA0E1C0ACA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 May 2017 19:46:50 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 71A9A926D1\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 May 2017 19:46:50 +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 DmWfqLPKqnPD for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 May 2017 19:46:49 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 72BFB92C2F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 May 2017 19:46:49 +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:48 -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:48 -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=\"100834256\"", "From": "Tony Nguyen <anthony.l.nguyen@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 12 May 2017 11:38:07 -0700", "Message-Id": "<20170512183810.26185-1-anthony.l.nguyen@intel.com>", "X-Mailer": "git-send-email 2.9.3", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH 1/4] ixgbe: Resolve truncation warning for\n\tq_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/ixgbe/ixgbe_main.c: In function ‘ixgbe_open’:\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c:3118: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/ixgbe/ixgbe_main.c:3118:6: note: directive argument in the range [0, 2147483647]\n \"%s-%s-%d\", netdev->name, \"TxRx\", ri++);\n ^~~~~~~~~~\ndrivers/net/ethernet/intel/ixgbe/ixgbe_main.c:3117: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/ixgbe/ixgbe_main.c | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex ee20a2b..04ccb64 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -3105,23 +3105,23 @@ int ixgbe_poll(struct napi_struct *napi, int budget)\n static int ixgbe_request_msix_irqs(struct ixgbe_adapter *adapter)\n {\n \tstruct net_device *netdev = adapter->netdev;\n+\tunsigned int ri = 0, ti = 0;\n \tint vector, err;\n-\tint ri = 0, ti = 0;\n \n \tfor (vector = 0; vector < adapter->num_q_vectors; vector++) {\n \t\tstruct ixgbe_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": [ "1/4" ] }