get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 811965,
    "url": "http://patchwork.ozlabs.org/api/patches/811965/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/150496959359.9654.1986960584525021648.stgit@bahia/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<150496959359.9654.1986960584525021648.stgit@bahia>",
    "list_archive_url": null,
    "date": "2017-09-09T15:06:33",
    "name": "[5/5] spapr_pci: handle FDT creation errors with _FDT()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e0353897dce8edfcad9d9970858bffd8acfbc787",
    "submitter": {
        "id": 69178,
        "url": "http://patchwork.ozlabs.org/api/people/69178/?format=api",
        "name": "Greg Kurz",
        "email": "groug@kaod.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/150496959359.9654.1986960584525021648.stgit@bahia/mbox/",
    "series": [
        {
            "id": 2354,
            "url": "http://patchwork.ozlabs.org/api/series/2354/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2354",
            "date": "2017-09-09T15:05:46",
            "name": "spapr_pci: various cleanups and improvements",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2354/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/811965/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/811965/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xqHfN1Qctz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 01:09:32 +1000 (AEST)",
            "from localhost ([::1]:49886 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dqhNy-0001Qu-9H\n\tfor incoming@patchwork.ozlabs.org; Sat, 09 Sep 2017 11:09:30 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:51176)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dqhLG-00082t-Ou\n\tfor qemu-devel@nongnu.org; Sat, 09 Sep 2017 11:06:44 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dqhLC-0006OS-6q\n\tfor qemu-devel@nongnu.org; Sat, 09 Sep 2017 11:06:42 -0400",
            "from 9.mo177.mail-out.ovh.net ([46.105.72.238]:35964)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <groug@kaod.org>) id 1dqhLC-0006MW-0m\n\tfor qemu-devel@nongnu.org; Sat, 09 Sep 2017 11:06:38 -0400",
            "from player714.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo177.mail-out.ovh.net (Postfix) with ESMTP id 677EB76A4D\n\tfor <qemu-devel@nongnu.org>; Sat,  9 Sep 2017 17:06:36 +0200 (CEST)",
            "from [192.168.0.243] (gar31-1-82-66-74-139.fbx.proxad.net\n\t[82.66.74.139]) (Authenticated sender: groug@kaod.org)\n\tby player714.ha.ovh.net (Postfix) with ESMTPA id 311B03C0073;\n\tSat,  9 Sep 2017 17:06:34 +0200 (CEST)"
        ],
        "From": "Greg Kurz <groug@kaod.org>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Sat, 09 Sep 2017 17:06:33 +0200",
        "Message-ID": "<150496959359.9654.1986960584525021648.stgit@bahia>",
        "In-Reply-To": "<150496954641.9654.1998704077006846521.stgit@bahia>",
        "References": "<150496954641.9654.1998704077006846521.stgit@bahia>",
        "User-Agent": "StGit/0.17.1-46-g6855-dirty",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "X-Ovh-Tracer-Id": "251075682732513619",
        "X-VR-SPAMSTATE": "OK",
        "X-VR-SPAMSCORE": "-100",
        "X-VR-SPAMCAUSE": "gggruggvucftvghtrhhoucdtuddrfeelledrfeeigdekjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]",
        "X-Received-From": "46.105.72.238",
        "Subject": "[Qemu-devel] [PATCH 5/5] spapr_pci: handle FDT creation errors with\n\t_FDT()",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "<qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Cc": "qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"
    },
    "content": "libfdt failures when creating the FDT should cause QEMU to terminate.\n\nLet's use the _FDT() macro which does just that instead of propagating\nthe error to the caller. spapr_populate_pci_child_dt() no longer needs\nto return a value in this case.\n\nNote that, on the way, this get rids of the following nonsensical lines:\n\n    g_assert(!ret);\n    if (ret) {\n\nSigned-off-by: Greg Kurz <groug@kaod.org>\n---\n hw/ppc/spapr_pci.c |   30 +++++++-----------------------\n 1 file changed, 7 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c\nindex abb9f05e7b75..75cd9392233e 100644\n--- a/hw/ppc/spapr_pci.c\n+++ b/hw/ppc/spapr_pci.c\n@@ -1204,12 +1204,12 @@ static gchar *pci_get_node_name(PCIDevice *dev)\n static uint32_t spapr_phb_get_pci_drc_index(sPAPRPHBState *phb,\n                                             PCIDevice *pdev);\n \n-static int spapr_populate_pci_child_dt(PCIDevice *dev, void *fdt, int offset,\n+static void spapr_populate_pci_child_dt(PCIDevice *dev, void *fdt, int offset,\n                                        sPAPRPHBState *sphb)\n {\n     ResourceProps rp;\n     bool is_bridge = false;\n-    int pci_status, err;\n+    int pci_status;\n     char *buf = NULL;\n     uint32_t drc_index = spapr_phb_get_pci_drc_index(sphb, dev);\n     uint32_t ccode = pci_default_read_config(dev, PCI_CLASS_PROG, 3);\n@@ -1274,11 +1274,8 @@ static int spapr_populate_pci_child_dt(PCIDevice *dev, void *fdt, int offset,\n                                                  ccode & 0xff)));\n \n     buf = spapr_phb_get_loc_code(sphb, dev);\n-    err = fdt_setprop_string(fdt, offset, \"ibm,loc-code\", buf);\n+    _FDT(fdt_setprop_string(fdt, offset, \"ibm,loc-code\", buf));\n     g_free(buf);\n-    if (err < 0) {\n-        return err;\n-    }\n \n     if (drc_index) {\n         _FDT(fdt_setprop_cell(fdt, offset, \"ibm,my-drc-index\", drc_index));\n@@ -1306,27 +1303,21 @@ static int spapr_populate_pci_child_dt(PCIDevice *dev, void *fdt, int offset,\n     if (sphb->pcie_ecs && pci_is_express(dev)) {\n         _FDT(fdt_setprop_cell(fdt, offset, \"ibm,pci-config-space-type\", 0x1));\n     }\n-\n-    return 0;\n }\n \n /* create OF node for pci device and required OF DT properties */\n static int spapr_create_pci_child_dt(sPAPRPHBState *phb, PCIDevice *dev,\n                                      void *fdt, int node_offset)\n {\n-    int offset, ret;\n+    int offset;\n     gchar *nodename;\n \n     nodename = pci_get_node_name(dev);\n-    offset = fdt_add_subnode(fdt, node_offset, nodename);\n+    _FDT(offset = fdt_add_subnode(fdt, node_offset, nodename));\n     g_free(nodename);\n \n-    ret = spapr_populate_pci_child_dt(dev, fdt, offset, phb);\n+    spapr_populate_pci_child_dt(dev, fdt, offset, phb);\n \n-    g_assert(!ret);\n-    if (ret) {\n-        return 0;\n-    }\n     return offset;\n }\n \n@@ -1416,10 +1407,6 @@ static void spapr_pci_plug(HotplugHandler *plug_handler,\n \n     fdt = create_device_tree(&fdt_size);\n     fdt_start_offset = spapr_create_pci_child_dt(phb, pdev, fdt, 0);\n-    if (!fdt_start_offset) {\n-        error_setg(&local_err, \"Failed to create pci child device tree node\");\n-        goto out;\n-    }\n \n     spapr_drc_attach(drc, DEVICE(pdev), fdt, fdt_start_offset, &local_err);\n     if (local_err) {\n@@ -2114,11 +2101,8 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb,\n \n     /* Start populating the FDT */\n     nodename = g_strdup_printf(\"pci@%\" PRIx64, phb->buid);\n-    bus_off = fdt_add_subnode(fdt, 0, nodename);\n+    _FDT(bus_off = fdt_add_subnode(fdt, 0, nodename));\n     g_free(nodename);\n-    if (bus_off < 0) {\n-        return bus_off;\n-    }\n \n     /* Write PHB properties */\n     _FDT(fdt_setprop_string(fdt, bus_off, \"device_type\", \"pci\"));\n",
    "prefixes": [
        "5/5"
    ]
}