Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/125822/?format=api
http://patches.dpdk.org/api/patches/125822/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230405160326.186921-5-bruce.richardson@intel.com/", "project": { "id": 1, "url": "http://patches.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": "<20230405160326.186921-5-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230405160326.186921-5-bruce.richardson@intel.com", "date": "2023-04-05T16:03:25", "name": "[v3,4/5] telemetry: rename local variables", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "cb8f73a4fc8c7131b0053f6487d6afef3b98d499", "submitter": { "id": 20, "url": "http://patches.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230405160326.186921-5-bruce.richardson@intel.com/mbox/", "series": [ { "id": 27629, "url": "http://patches.dpdk.org/api/series/27629/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27629", "date": "2023-04-05T16:03:21", "name": "telemetry: remove variable length arrays", "version": 3, "mbox": "http://patches.dpdk.org/series/27629/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/125822/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/125822/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3D9AF428D4;\n\tWed, 5 Apr 2023 18:05:10 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 41EF942D3A;\n\tWed, 5 Apr 2023 18:04:49 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id 9506042C24\n for <dev@dpdk.org>; Wed, 5 Apr 2023 18:04:46 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 Apr 2023 09:04:21 -0700", "from silpixa00401385.ir.intel.com ([10.237.214.40])\n by fmsmga001.fm.intel.com with ESMTP; 05 Apr 2023 09:04:20 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1680710686; x=1712246686;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=kmwz0JZLMz/PYB9q+460ZarpveznP3XHVPXKHnvqjbk=;\n b=NAhzmwV87OL+o/3xLXeBUUesHUhFaOH8zVEmyqQ8FbHnnlT9YpR1xDWN\n EaFlTLcP+x664KejE5HudjEbjX2nvQFNq5CLwr4dwDQL9nslwws/w8IOD\n oFYh/GNuHJYmjkRtYNitWCSgZkuWd9yfwn578DHAMApoU6vvWCm9as+lQ\n qE2JiTyNwytutP5IQrqRrMsDS2c/lgY9TzJ2+n2X+1e21BZwDdr2rtutr\n ExBsic2AzMhohZErbB2RGJghVrCWCnIyzrB5auJLCYZoQSBghJRGUXlfV\n kMa0khW42aiPYA+CYhf9C8VFKoXiZRmmeh1N8Y6Ink4YcYcmlYeSZmnOQ Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10671\"; a=\"341218622\"", "E=Sophos;i=\"5.98,321,1673942400\"; d=\"scan'208\";a=\"341218622\"", "E=McAfee;i=\"6600,9927,10671\"; a=\"830405825\"", "E=Sophos;i=\"5.98,321,1673942400\"; d=\"scan'208\";a=\"830405825\"" ], "X-ExtLoop1": "1", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "ciara.power@intel.com, roretzla@linux.microsoft.com,\n Bruce Richardson <bruce.richardson@intel.com>", "Subject": "[PATCH v3 4/5] telemetry: rename local variables", "Date": "Wed, 5 Apr 2023 17:03:25 +0100", "Message-Id": "<20230405160326.186921-5-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.37.2", "In-Reply-To": "<20230405160326.186921-1-bruce.richardson@intel.com>", "References": "<20230310181836.162336-1-bruce.richardson@intel.com>\n <20230405160326.186921-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "In the newly separated out function, rename \"tmp\" to \"buf\" to have more\nmeaningful variable names.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n\n---\n\nWhen committing, this patch can be merged with the previous. I've kept\nthem separate for now, as it makes reviewing a lot easier.\n---\n lib/telemetry/telemetry_json.h | 32 ++++++++++++++++----------------\n 1 file changed, 16 insertions(+), 16 deletions(-)", "diff": "diff --git a/lib/telemetry/telemetry_json.h b/lib/telemetry/telemetry_json.h\nindex aada523a27..c087b833eb 100644\n--- a/lib/telemetry/telemetry_json.h\n+++ b/lib/telemetry/telemetry_json.h\n@@ -84,44 +84,44 @@ static const char control_chars[0x20] = {\n * directly, but returns 0 on overflow. Otherwise returns number of chars written to buffer.\n */\n static inline int\n-__json_format_str_to_buf(char *tmp, const int len,\n+__json_format_str_to_buf(char *buf, const int len,\n \t\tconst char *prefix, const char *str, const char *suffix)\n {\n-\tint tmpidx = 0;\n+\tint bufidx = 0;\n \n-\twhile (*prefix != '\\0' && tmpidx < len)\n-\t\ttmp[tmpidx++] = *prefix++;\n-\tif (tmpidx >= len)\n+\twhile (*prefix != '\\0' && bufidx < len)\n+\t\tbuf[bufidx++] = *prefix++;\n+\tif (bufidx >= len)\n \t\treturn 0;\n \n \twhile (*str != '\\0') {\n \t\tif (*str < (int)RTE_DIM(control_chars)) {\n \t\t\tint idx = *str; /* compilers don't like char type as index */\n \t\t\tif (control_chars[idx] != 0) {\n-\t\t\t\ttmp[tmpidx++] = '\\\\';\n-\t\t\t\ttmp[tmpidx++] = control_chars[idx];\n+\t\t\t\tbuf[bufidx++] = '\\\\';\n+\t\t\t\tbuf[bufidx++] = control_chars[idx];\n \t\t\t}\n \t\t} else if (*str == '\"' || *str == '\\\\') {\n-\t\t\ttmp[tmpidx++] = '\\\\';\n-\t\t\ttmp[tmpidx++] = *str;\n+\t\t\tbuf[bufidx++] = '\\\\';\n+\t\t\tbuf[bufidx++] = *str;\n \t\t} else\n-\t\t\ttmp[tmpidx++] = *str;\n+\t\t\tbuf[bufidx++] = *str;\n \t\t/* we always need space for (at minimum) closing quote and null character.\n \t\t * Ensuring at least two free characters also means we can always take an\n \t\t * escaped character like \"\\n\" without overflowing\n \t\t */\n-\t\tif (tmpidx > len - 2)\n+\t\tif (bufidx > len - 2)\n \t\t\treturn 0;\n \t\tstr++;\n \t}\n \n-\twhile (*suffix != '\\0' && tmpidx < len)\n-\t\ttmp[tmpidx++] = *suffix++;\n-\tif (tmpidx >= len)\n+\twhile (*suffix != '\\0' && bufidx < len)\n+\t\tbuf[bufidx++] = *suffix++;\n+\tif (bufidx >= len)\n \t\treturn 0;\n \n-\ttmp[tmpidx] = '\\0';\n-\treturn tmpidx;\n+\tbuf[bufidx] = '\\0';\n+\treturn bufidx;\n }\n \n /**\n", "prefixes": [ "v3", "4/5" ] }{ "id": 125822, "url": "