get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 6149,
    "url": "https://patches.dpdk.org/api/patches/6149/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1436259634-7077-5-git-send-email-david.marchand@6wind.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1436259634-7077-5-git-send-email-david.marchand@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1436259634-7077-5-git-send-email-david.marchand@6wind.com",
    "date": "2015-07-07T09:00:32",
    "name": "[dpdk-dev,4/6] eal/linux: rework while loop",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "785ab4cbebef74808432a1dd3a2e4863a0cc99a0",
    "submitter": {
        "id": 3,
        "url": "https://patches.dpdk.org/api/people/3/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1436259634-7077-5-git-send-email-david.marchand@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/6149/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/6149/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 6F24C5A68;\n\tTue,  7 Jul 2015 11:00:56 +0200 (CEST)",
            "from mail-wi0-f181.google.com (mail-wi0-f181.google.com\n\t[209.85.212.181]) by dpdk.org (Postfix) with ESMTP id 52E6C5A52\n\tfor <dev@dpdk.org>; Tue,  7 Jul 2015 11:00:52 +0200 (CEST)",
            "by widjy10 with SMTP id jy10so182355928wid.1\n\tfor <dev@dpdk.org>; Tue, 07 Jul 2015 02:00:52 -0700 (PDT)",
            "from alcyon.dev.6wind.com (6wind.net2.nerim.net. [213.41.151.210])\n\tby mx.google.com with ESMTPSA id\n\ty19sm32737674wia.15.2015.07.07.02.00.50 for <dev@dpdk.org>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 07 Jul 2015 02:00:51 -0700 (PDT)"
        ],
        "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:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=d3roc7k7Id2GWK8K/zJIUIsdfoUuuAS737BMaj4D/vI=;\n\tb=LKlSUT3zBVppHJn1RkVAiwfdsQqUkyNO9SzI9Us9jOOD4OUtNhShJGp+Opokbevu30\n\tsbsVlxpfD6eDL+on5kCltmi67chY1ztqs3nrW0FWxFdLpWsOFPjqU2tH1WWA1CXoZVej\n\tfKjvkFZgV6C29Df8TuT2X1yjbXBVA92wSirZoHMCxJIL8spKEvwHOUofweuwAZeiKGE7\n\t0xtGSHcWjKswhBE/eqYMgb0KNk8/bQXiNaylMVC+HtpsKQc2Axd+O4jFyUk2T//SldtE\n\tsXUC0I5t4IyvfqNl7i4BdRfzg+spR8oxgjoVxDSZHUisixd2Sl3qDOHUfWRTs7F2mMr2\n\t8uFQ==",
        "X-Gm-Message-State": "ALoCoQl0a1dkrPzapwnSXAk5PBgEgMI3tq+0ZBYoau5KgmutrAQTH1OcVArZQpWdOvw2tyrwNVQ+",
        "X-Received": "by 10.194.203.3 with SMTP id km3mr5977098wjc.114.1436259652176; \n\tTue, 07 Jul 2015 02:00:52 -0700 (PDT)",
        "From": "David Marchand <david.marchand@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue,  7 Jul 2015 11:00:32 +0200",
        "Message-Id": "<1436259634-7077-5-git-send-email-david.marchand@6wind.com>",
        "X-Mailer": "git-send-email 1.7.10.4",
        "In-Reply-To": "<1436259634-7077-1-git-send-email-david.marchand@6wind.com>",
        "References": "<1436259634-7077-1-git-send-email-david.marchand@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH 4/6] eal/linux: rework while loop",
        "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": "Replace this while loop with a for loop and simplify error handling.\nIndent is broken on purpose, fixed in next commit.\n\nSigned-off-by: David Marchand <david.marchand@6wind.com>\n---\n lib/librte_eal/linuxapp/eal/eal_hugepage_info.c |   28 ++++++++++++-----------\n 1 file changed, 15 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c\nindex b474159..de3f48d 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c\n@@ -282,12 +282,13 @@ eal_hugepage_info_init(void)\n \t\trte_panic(\"Cannot open directory %s to read system hugepage \"\n \t\t\t  \"info\\n\", sys_dir_path);\n \n-\tdirent = readdir(dir);\n-\twhile (dirent != NULL) {\n+\tfor (dirent = readdir(dir); dirent != NULL; dirent = readdir(dir)) {\n \t\tstruct hugepage_info *hpi;\n \n \t\tif (strncmp(dirent->d_name, dirent_start_text,\n-\t\t\t    dirent_start_len) == 0) {\n+\t\t\t    dirent_start_len) != 0)\n+\t\t\tcontinue;\n+\n \t\t\thpi = &internal_config.hugepage_info[num_sizes];\n \t\t\thpi->hugepage_sz = rte_str_to_size(&dirent->d_name[dirent_start_len]);\n \t\t\thpi->hugedir = get_hugepage_dir(hpi->hugepage_sz);\n@@ -301,21 +302,20 @@ eal_hugepage_info_init(void)\n \t\t\t\t\tRTE_LOG(INFO, EAL, \"%lu hugepages of size %lu reserved, \"\n \t\t\t\t\t\t\"but no mounted hugetlbfs found for that size\\n\",\n \t\t\t\t\t\tnum_pages, hpi->hugepage_sz);\n-\t\t\t} else {\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\n \t\t\t\t/* try to obtain a writelock */\n \t\t\t\thpi->lock_descriptor = open(hpi->hugedir, O_RDONLY);\n \n \t\t\t\t/* if blocking lock failed */\n \t\t\t\tif (flock(hpi->lock_descriptor, LOCK_EX) == -1) {\n \t\t\t\t\tRTE_LOG(CRIT, EAL, \"Failed to lock hugepage directory!\\n\");\n-\t\t\t\t\tclosedir(dir);\n-\t\t\t\t\treturn -1;\n+\t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\t/* clear out the hugepages dir from unused pages */\n-\t\t\t\tif (clear_hugedir(hpi->hugedir) == -1) {\n-\t\t\t\t\tclosedir(dir);\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n+\t\t\t\tif (clear_hugedir(hpi->hugedir) == -1)\n+\t\t\t\t\tbreak;\n \n \t\t\t\t/* for now, put all pages into socket 0,\n \t\t\t\t * later they will be sorted */\n@@ -328,11 +328,13 @@ eal_hugepage_info_init(void)\n #endif\n \n \t\t\t\tnum_sizes++;\n-\t\t\t}\n-\t\t}\n-\t\tdirent = readdir(dir);\n \t}\n \tclosedir(dir);\n+\n+\t/* something went wrong, and we broke from the for loop above */\n+\tif (dirent != NULL)\n+\t\treturn -1;\n+\n \tinternal_config.num_hugepage_sizes = num_sizes;\n \n \t/* sort the page directory entries by size, largest to smallest */\n",
    "prefixes": [
        "dpdk-dev",
        "4/6"
    ]
}