Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/20232/?format=api
http://patchwork.dpdk.org/api/patches/20232/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1486476777-24768-15-git-send-email-bruce.richardson@intel.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1486476777-24768-15-git-send-email-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1486476777-24768-15-git-send-email-bruce.richardson@intel.com", "date": "2017-02-07T14:12:52", "name": "[dpdk-dev,RFCv3,14/19] ring: reduce scope of local variables", "commit_ref": null, "pull_url": null, "state": "rfc", "archived": true, "hash": "ec0bc7c0d6a12adcc2a761ccecf7227ad59eb921", "submitter": { "id": 20, "url": "http://patchwork.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": null, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1486476777-24768-15-git-send-email-bruce.richardson@intel.com/mbox/", "series": [], "comments": "http://patchwork.dpdk.org/api/patches/20232/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/20232/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id C6523FA3C;\n\tTue, 7 Feb 2017 15:14:17 +0100 (CET)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id A6194F96F\n\tfor <dev@dpdk.org>; Tue, 7 Feb 2017 15:14:16 +0100 (CET)", "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby orsmga104.jf.intel.com with ESMTP; 07 Feb 2017 06:14:16 -0800", "from sivswdev01.ir.intel.com (HELO localhost.localdomain)\n\t([10.237.217.45])\n\tby orsmga005.jf.intel.com with ESMTP; 07 Feb 2017 06:14:14 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.33,346,1477983600\"; d=\"scan'208\";a=\"61814045\"", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "olivier.matz@6wind.com", "Cc": "thomas.monjalon@6wind.com, keith.wiles@intel.com,\n\tkonstantin.ananyev@intel.com, stephen@networkplumber.org, dev@dpdk.org,\n\tBruce Richardson <bruce.richardson@intel.com>", "Date": "Tue, 7 Feb 2017 14:12:52 +0000", "Message-Id": "<1486476777-24768-15-git-send-email-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": "<20170125121456.GA24344@bricha3-MOBL3.ger.corp.intel.com>", "References": "<20170125121456.GA24344@bricha3-MOBL3.ger.corp.intel.com>", "Subject": "[dpdk-dev] [PATCH RFCv3 14/19] ring: reduce scope of local variables", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "The local variable i is only used for loop control so define it in\nthe enqueue and dequeue blocks directly, rather than at the function\nlevel.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/librte_ring/rte_ring.h | 6 ++----\n 1 file changed, 2 insertions(+), 4 deletions(-)", "diff": "diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h\nindex b6123ba..6aabd7f 100644\n--- a/lib/librte_ring/rte_ring.h\n+++ b/lib/librte_ring/rte_ring.h\n@@ -281,6 +281,7 @@ void rte_ring_dump(FILE *f, const struct rte_ring *r);\n * Placed here since identical code needed in both\n * single and multi producer enqueue functions */\n #define ENQUEUE_PTRS() do { \\\n+\tunsigned int i; \\\n \tconst uint32_t size = r->size; \\\n \tuint32_t idx = prod_head & mask; \\\n \tif (likely(idx + n < size)) { \\\n@@ -307,6 +308,7 @@ void rte_ring_dump(FILE *f, const struct rte_ring *r);\n * Placed here since identical code needed in both\n * single and multi consumer dequeue functions */\n #define DEQUEUE_PTRS() do { \\\n+\tunsigned int i; \\\n \tuint32_t idx = cons_head & mask; \\\n \tconst uint32_t size = r->size; \\\n \tif (likely(idx + n < size)) { \\\n@@ -361,7 +363,6 @@ __rte_ring_mp_do_enqueue(struct rte_ring *r, void * const *obj_table,\n \tuint32_t cons_tail, free_entries;\n \tconst unsigned int max = n;\n \tint success;\n-\tunsigned int i;\n \tuint32_t mask = r->mask;\n \n \t/* move prod.head atomically */\n@@ -435,7 +436,6 @@ __rte_ring_sp_do_enqueue(struct rte_ring *r, void * const *obj_table,\n {\n \tuint32_t prod_head, cons_tail;\n \tuint32_t prod_next, free_entries;\n-\tunsigned int i;\n \tuint32_t mask = r->mask;\n \n \tprod_head = r->prod.head;\n@@ -504,7 +504,6 @@ __rte_ring_mc_do_dequeue(struct rte_ring *r, void **obj_table,\n \tuint32_t cons_next, entries;\n \tconst unsigned max = n;\n \tint success;\n-\tunsigned int i;\n \tuint32_t mask = r->mask;\n \n \t/* move cons.head atomically */\n@@ -580,7 +579,6 @@ __rte_ring_sc_do_dequeue(struct rte_ring *r, void **obj_table,\n {\n \tuint32_t cons_head, prod_tail;\n \tuint32_t cons_next, entries;\n-\tunsigned int i;\n \tuint32_t mask = r->mask;\n \n \tcons_head = r->cons.head;\n", "prefixes": [ "dpdk-dev", "RFCv3", "14/19" ] }{ "id": 20232, "url": "