get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/14669/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 14669,
    "url": "http://patches.dpdk.org/api/patches/14669/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1467972855-21873-7-git-send-email-thomas.monjalon@6wind.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": "<1467972855-21873-7-git-send-email-thomas.monjalon@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1467972855-21873-7-git-send-email-thomas.monjalon@6wind.com",
    "date": "2016-07-08T10:14:11",
    "name": "[dpdk-dev,v2,06/10] pmdinfogen: fix build warnings",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "76593aa7da3ec6b6200e9de8e8dc648001044137",
    "submitter": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/people/1/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas.monjalon@6wind.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1467972855-21873-7-git-send-email-thomas.monjalon@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/14669/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/14669/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 B031E5A71;\n\tFri,  8 Jul 2016 12:14:26 +0200 (CEST)",
            "from mail-wm0-f41.google.com (mail-wm0-f41.google.com\n\t[74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 2B97F5A64\n\tfor <dev@dpdk.org>; Fri,  8 Jul 2016 12:14:25 +0200 (CEST)",
            "by mail-wm0-f41.google.com with SMTP id z126so10200969wme.0\n\tfor <dev@dpdk.org>; Fri, 08 Jul 2016 03:14:25 -0700 (PDT)",
            "from XPS13.localdomain (184.203.134.77.rev.sfr.net.\n\t[77.134.203.184])\n\tby smtp.gmail.com with ESMTPSA id d4sm8146wjb.47.2016.07.08.03.14.23\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 08 Jul 2016 03:14:24 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=rMRTL+XrRME+7VGRSxGwonKvfYmkLktM8G11UXehMY8=;\n\tb=j/0kDr2W3LppkbAvxpkeVRl7cCIPAsik0lLOI6cfTfCwkod2510xqI1TERksUO0gl3\n\tzcnpH2soQIZY13JYRGY74eshqR6koAKMj3fLPVLcFzkXC5ag8A1b2D/UhGii6a4TNkYr\n\tgIRerku6Mq3/mQTHFI1hWGVyZ4cNdZ4+lV+uLc6jv80+82xYQo8Irf3uutz7EZxnnaIr\n\t3XDjJJbfS5UTEF3gtT2vRtgkWgAfOiXenRjjx8qHpQPuLb4c2seK1RSyRkBr8aMXDuGD\n\tFC8C3yGRoCcTBPUwMRuGYg3ZJX1Szi6wlWqHwTB5PgxKLnN5hV5PesP8Lr6jftbjYKl1\n\t/9bw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=rMRTL+XrRME+7VGRSxGwonKvfYmkLktM8G11UXehMY8=;\n\tb=TabyIvOOANG1sOEuRAc4jG4Gh1EnxfkCHcumbRKCjInrZBzBGTSusGmdInkL1yxNF5\n\tKJKF2s3e/67uIN1tcH4iuc0dbFwwFkI+0yDrIFMiQ1FPtqLZfUZaFHvnj6zi6+84bfQI\n\tjJN0xmxn1Jo677JQSg5vxyDHOw+bOrFMcrsrSdw5ryN8AMaC31vfVjTkpNGkf/P4q/8r\n\t21pDkQQLMCi6YosVveNUSrsyuRWMoUJsLiI9Itg7/OA+3k/PqL/9ptwiZJaZ+WND/xxX\n\tJDPtSP7o9F847MSQJ4u79sncCY8r44UTbPcvmWwyh7W+aYroXBtp4MIFwzu0JtrenO9Q\n\tFZ8A==",
        "X-Gm-Message-State": "ALyK8tKsw2LIYyGrG/2Rer7WtGnFQemP9g4X7pAYcRFxzOJrIRd1B0wWhMMQYPkFCuC1hHyX",
        "X-Received": "by 10.194.39.6 with SMTP id l6mr4485921wjk.139.1467972864892;\n\tFri, 08 Jul 2016 03:14:24 -0700 (PDT)",
        "From": "Thomas Monjalon <thomas.monjalon@6wind.com>",
        "To": "Neil Horman <nhorman@tuxdriver.com>",
        "Cc": "dev@dpdk.org",
        "Date": "Fri,  8 Jul 2016 12:14:11 +0200",
        "Message-Id": "<1467972855-21873-7-git-send-email-thomas.monjalon@6wind.com>",
        "X-Mailer": "git-send-email 2.7.0",
        "In-Reply-To": "<1467972855-21873-1-git-send-email-thomas.monjalon@6wind.com>",
        "References": "<1467905790-10597-1-git-send-email-thomas.monjalon@6wind.com>\n\t<1467972855-21873-1-git-send-email-thomas.monjalon@6wind.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 06/10] pmdinfogen: fix build warnings",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "When compiled with a standard clang, pmdinfogen can raise a warning:\n    buildtools/pmdinfogen/pmdinfogen.c:365:1: warning:\n    control reaches end of non-void function\n\nActually there can be more warnings with stricter compilers.\nIn order to catch them early and fix most of them, the DPDK standard flags\nWERROR_FLAGS are used.\n\nThe warnings fixed are:\n    no previous prototype for ...\n    no return statement in function returning non-void\n    variable ‘secstrings’ set but not used\n    ‘sec_name’ defined but not used\n    ‘get_symbol_index’ defined but not used\n    pointer of type ‘void *’ used in arithmetic\n\nFixes: 98b0fdb0ffc6 (\"pmdinfogen: add buildtools and pmdinfogen utility\")\n\nSigned-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>\n---\n buildtools/pmdinfogen/Makefile     |  4 +--\n buildtools/pmdinfogen/pmdinfogen.c | 58 ++++++++++++--------------------------\n 2 files changed, 20 insertions(+), 42 deletions(-)",
    "diff": "diff --git a/buildtools/pmdinfogen/Makefile b/buildtools/pmdinfogen/Makefile\nindex 125901b..3885d3b 100644\n--- a/buildtools/pmdinfogen/Makefile\n+++ b/buildtools/pmdinfogen/Makefile\n@@ -41,9 +41,9 @@ HOSTAPP = pmdinfogen\n #\n SRCS-y += pmdinfogen.c\n \n-HOST_EXTRA_CFLAGS += -g -I${RTE_OUTPUT}/include\n+HOST_CFLAGS += $(WERROR_FLAGS) -g\n+HOST_CFLAGS += -I$(RTE_OUTPUT)/include\n \n DEPDIRS-y += lib/librte_eal\n \n include $(RTE_SDK)/mk/rte.hostapp.mk\n-\ndiff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmdinfogen.c\nindex 0947dc6..beb06f1 100644\n--- a/buildtools/pmdinfogen/pmdinfogen.c\n+++ b/buildtools/pmdinfogen/pmdinfogen.c\n@@ -15,6 +15,7 @@\n #include <limits.h>\n #include <stdbool.h>\n #include <errno.h>\n+#include <rte_common.h>\n #include \"pmdinfogen.h\"\n \n #ifdef RTE_ARCH_64\n@@ -32,7 +33,7 @@ static const char *sym_name(struct elf_info *elf, Elf_Sym *sym)\n \t\treturn \"(unknown)\";\n }\n \n-void *grab_file(const char *filename, unsigned long *size)\n+static void *grab_file(const char *filename, unsigned long *size)\n {\n \tstruct stat st;\n \tvoid *map = MAP_FAILED;\n@@ -59,7 +60,7 @@ failed:\n   * spaces in the beginning of the line is trimmed away.\n   * Return a pointer to a static buffer.\n   **/\n-void release_file(void *file, unsigned long size)\n+static void release_file(void *file, unsigned long size)\n {\n \tmunmap(file, size);\n }\n@@ -67,9 +68,8 @@ void release_file(void *file, unsigned long size)\n \n static void *get_sym_value(struct elf_info *info, const Elf_Sym *sym)\n {\n-\tvoid *ptr = (void *)info->hdr + info->sechdrs[sym->st_shndx].sh_offset;\n-\n-\treturn (void *)(ptr + sym->st_value);\n+\treturn RTE_PTR_ADD(info->hdr,\n+\t\tinfo->sechdrs[sym->st_shndx].sh_offset + sym->st_value);\n }\n \n static Elf_Sym *find_sym_in_symtab(struct elf_info *info,\n@@ -95,7 +95,6 @@ static int parse_elf(struct elf_info *info, const char *filename)\n \tElf_Ehdr *hdr;\n \tElf_Shdr *sechdrs;\n \tElf_Sym  *sym;\n-\tconst char *secstrings;\n \tint endian;\n \tunsigned int symtab_idx = ~0U, symtab_shndx_idx = ~0U;\n \n@@ -140,7 +139,7 @@ static int parse_elf(struct elf_info *info, const char *filename)\n \thdr->e_shnum     = TO_NATIVE(endian, 16, hdr->e_shnum);\n \thdr->e_shstrndx  = TO_NATIVE(endian, 16, hdr->e_shstrndx);\n \n-\tsechdrs = (void *)hdr + hdr->e_shoff;\n+\tsechdrs = RTE_PTR_ADD(hdr, hdr->e_shoff);\n \tinfo->sechdrs = sechdrs;\n \n \t/* Check if file offset is correct */\n@@ -191,7 +190,6 @@ static int parse_elf(struct elf_info *info, const char *filename)\n \t\t\tTO_NATIVE(endian, ADDR_SIZE, sechdrs[i].sh_entsize);\n \t}\n \t/* Find symbol table. */\n-\tsecstrings = (void *)hdr + sechdrs[info->secindex_strings].sh_offset;\n \tfor (i = 1; i < info->num_sections; i++) {\n \t\tint nobits = sechdrs[i].sh_type == SHT_NOBITS;\n \n@@ -206,22 +204,22 @@ static int parse_elf(struct elf_info *info, const char *filename)\n \t\tif (sechdrs[i].sh_type == SHT_SYMTAB) {\n \t\t\tunsigned int sh_link_idx;\n \t\t\tsymtab_idx = i;\n-\t\t\tinfo->symtab_start = (void *)hdr +\n-\t\t\t    sechdrs[i].sh_offset;\n-\t\t\tinfo->symtab_stop  = (void *)hdr +\n-\t\t\t    sechdrs[i].sh_offset + sechdrs[i].sh_size;\n+\t\t\tinfo->symtab_start = RTE_PTR_ADD(hdr,\n+\t\t\t\tsechdrs[i].sh_offset);\n+\t\t\tinfo->symtab_stop  = RTE_PTR_ADD(hdr,\n+\t\t\t\tsechdrs[i].sh_offset + sechdrs[i].sh_size);\n \t\t\tsh_link_idx = sechdrs[i].sh_link;\n-\t\t\tinfo->strtab       = (void *)hdr +\n-\t\t\t    sechdrs[sh_link_idx].sh_offset;\n+\t\t\tinfo->strtab       = RTE_PTR_ADD(hdr,\n+\t\t\t\tsechdrs[sh_link_idx].sh_offset);\n \t\t}\n \n \t\t/* 32bit section no. table? (\"more than 64k sections\") */\n \t\tif (sechdrs[i].sh_type == SHT_SYMTAB_SHNDX) {\n \t\t\tsymtab_shndx_idx = i;\n-\t\t\tinfo->symtab_shndx_start = (void *)hdr +\n-\t\t\t    sechdrs[i].sh_offset;\n-\t\t\tinfo->symtab_shndx_stop  = (void *)hdr +\n-\t\t\t    sechdrs[i].sh_offset + sechdrs[i].sh_size;\n+\t\t\tinfo->symtab_shndx_start = RTE_PTR_ADD(hdr,\n+\t\t\t\tsechdrs[i].sh_offset);\n+\t\t\tinfo->symtab_shndx_stop  = RTE_PTR_ADD(hdr,\n+\t\t\t\tsechdrs[i].sh_offset + sechdrs[i].sh_size);\n \t\t}\n \t}\n \tif (!info->symtab_start)\n@@ -262,28 +260,6 @@ static void parse_elf_finish(struct elf_info *info)\n \t}\n }\n \n-static const char *sec_name(struct elf_info *elf, int secindex)\n-{\n-\tElf_Shdr *sechdrs = elf->sechdrs;\n-\treturn (void *)elf->hdr +\n-\t\telf->sechdrs[elf->secindex_strings].sh_offset +\n-\t\tsechdrs[secindex].sh_name;\n-}\n-\n-static int get_symbol_index(struct elf_info *info, Elf_Sym *sym)\n-{\n-\tconst char *name =  sym_name(info, sym);\n-\tconst char *idx;\n-\n-\tidx = name;\n-\twhile (idx) {\n-\t\tif (isdigit(*idx))\n-\t\t\treturn atoi(idx);\n-\t\tidx++;\n-\t}\n-\treturn -1;\n-}\n-\n struct opt_tag {\n \tconst char *suffix;\n \tconst char *json_id;\n@@ -362,6 +338,8 @@ static int locate_pmd_entries(struct elf_info *info)\n \t\t\t}\n \t\t}\n \t} while (last);\n+\n+\treturn 0;\n }\n \n static void output_pmd_info_string(struct elf_info *info, char *outfile)\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "06/10"
    ]
}