get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 527581,
    "url": "http://patchwork.ozlabs.org/api/patches/527581/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1444276739-20372-6-git-send-email-gwshan@linux.vnet.ibm.com/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<1444276739-20372-6-git-send-email-gwshan@linux.vnet.ibm.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1444276739-20372-6-git-send-email-gwshan@linux.vnet.ibm.com/",
    "date": "2015-10-08T03:58:56",
    "name": "[v2,5/8] powerpc/pseries: Cleanup on pseries_eeh_get_state()",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "3497482bf97f7c931d575bed22d02dff878000b4",
    "submitter": {
        "id": 63923,
        "url": "http://patchwork.ozlabs.org/api/people/63923/?format=api",
        "name": "Gavin Shan",
        "email": "gwshan@linux.vnet.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1444276739-20372-6-git-send-email-gwshan@linux.vnet.ibm.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/527581/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/527581/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org",
            "linuxppc-dev@ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 8476114029C\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  8 Oct 2015 15:08:18 +1100 (AEDT)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 68F191A0CAD\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  8 Oct 2015 15:08:18 +1100 (AEDT)",
            "from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 920371A01D7\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu,  8 Oct 2015 15:00:24 +1100 (AEDT)",
            "by ozlabs.org (Postfix)\n\tid 81ACB140D8A; Thu,  8 Oct 2015 15:00:24 +1100 (AEDT)",
            "from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143])\n\t(using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 67CBB140D87\n\tfor <linuxppc-dev@ozlabs.org>; Thu,  8 Oct 2015 15:00:24 +1100 (AEDT)",
            "from /spool/local\n\tby e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@ozlabs.org> from <gwshan@linux.vnet.ibm.com>;\n\tThu, 8 Oct 2015 14:00:24 +1000",
            "from d23dlp02.au.ibm.com (202.81.31.213)\n\tby e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 8 Oct 2015 14:00:22 +1000",
            "from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219])\n\tby d23dlp02.au.ibm.com (Postfix) with ESMTP id E3D992BB004D\n\tfor <linuxppc-dev@ozlabs.org>; Thu,  8 Oct 2015 15:00:21 +1100 (EST)",
            "from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139])\n\tby d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tt98409f316515174\n\tfor <linuxppc-dev@ozlabs.org>; Thu, 8 Oct 2015 15:00:17 +1100",
            "from d23av04.au.ibm.com (localhost [127.0.0.1])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tt983xnsb016666\n\tfor <linuxppc-dev@ozlabs.org>; Thu, 8 Oct 2015 14:59:49 +1100",
            "from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tt983xnWr016197; Thu, 8 Oct 2015 14:59:49 +1100",
            "from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114])\n\tby ozlabs.au.ibm.com (Postfix) with ESMTP id E8E2AA03E0;\n\tThu,  8 Oct 2015 14:59:01 +1100 (AEDT)",
            "from gwshan (shangw.ozlabs.ibm.com [10.61.2.199])\n\tby bran.ozlabs.ibm.com (Postfix) with ESMTP id E105FE460C;\n\tThu,  8 Oct 2015 14:59:01 +1100 (AEDT)",
            "by gwshan (Postfix, from userid 1000)\n\tid D7D37942239; Thu,  8 Oct 2015 14:59:01 +1100 (AEDT)"
        ],
        "X-Helo": "d23dlp02.au.ibm.com",
        "X-MailFrom": "gwshan@linux.vnet.ibm.com",
        "X-RcptTo": "linuxppc-dev@ozlabs.org",
        "From": "Gavin Shan <gwshan@linux.vnet.ibm.com>",
        "To": "linuxppc-dev@ozlabs.org",
        "Subject": "[PATCH v2 5/8] powerpc/pseries: Cleanup on pseries_eeh_get_state()",
        "Date": "Thu,  8 Oct 2015 14:58:56 +1100",
        "Message-Id": "<1444276739-20372-6-git-send-email-gwshan@linux.vnet.ibm.com>",
        "X-Mailer": "git-send-email 2.1.0",
        "In-Reply-To": "<1444276739-20372-1-git-send-email-gwshan@linux.vnet.ibm.com>",
        "References": "<1444276739-20372-1-git-send-email-gwshan@linux.vnet.ibm.com>",
        "X-TM-AS-MML": "disable",
        "X-Content-Scanned": "Fidelis XPS MAILER",
        "x-cbid": "15100804-1618-0000-0000-000002E070ED",
        "X-BeenThere": "linuxppc-dev@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.20",
        "Precedence": "list",
        "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>",
        "Cc": "Gavin Shan <gwshan@linux.vnet.ibm.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"
    },
    "content": "This cleans up pseries_eeh_get_state(), no functional changes:\n\n   * Return EEH_STATE_NOT_SUPPORT early when the 2nd RTAS output\n     argument is zero to avoid nested if statements.\n   * Skip clearing bits in the PE state represented by variable\n     \"result\" to simplify the code.\n\nSigned-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>\n---\n arch/powerpc/platforms/pseries/eeh_pseries.c | 60 ++++++++++++----------------\n 1 file changed, 26 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c\nindex 1ba55d0..ac3ffd9 100644\n--- a/arch/powerpc/platforms/pseries/eeh_pseries.c\n+++ b/arch/powerpc/platforms/pseries/eeh_pseries.c\n@@ -433,42 +433,34 @@ static int pseries_eeh_get_state(struct eeh_pe *pe, int *state)\n \t\treturn ret;\n \n \t/* Parse the result out */\n-\tresult = 0;\n-\tif (rets[1]) {\n-\t\tswitch(rets[0]) {\n-\t\tcase 0:\n-\t\t\tresult &= ~EEH_STATE_RESET_ACTIVE;\n-\t\t\tresult |= EEH_STATE_MMIO_ACTIVE;\n-\t\t\tresult |= EEH_STATE_DMA_ACTIVE;\n-\t\t\tbreak;\n-\t\tcase 1:\n-\t\t\tresult |= EEH_STATE_RESET_ACTIVE;\n-\t\t\tresult |= EEH_STATE_MMIO_ACTIVE;\n-\t\t\tresult |= EEH_STATE_DMA_ACTIVE;\n-\t\t\tbreak;\n-\t\tcase 2:\n-\t\t\tresult &= ~EEH_STATE_RESET_ACTIVE;\n-\t\t\tresult &= ~EEH_STATE_MMIO_ACTIVE;\n-\t\t\tresult &= ~EEH_STATE_DMA_ACTIVE;\n-\t\t\tbreak;\n-\t\tcase 4:\n-\t\t\tresult &= ~EEH_STATE_RESET_ACTIVE;\n-\t\t\tresult &= ~EEH_STATE_MMIO_ACTIVE;\n-\t\t\tresult &= ~EEH_STATE_DMA_ACTIVE;\n-\t\t\tresult |= EEH_STATE_MMIO_ENABLED;\n-\t\t\tbreak;\n-\t\tcase 5:\n-\t\t\tif (rets[2]) {\n-\t\t\t\tif (state) *state = rets[2];\n-\t\t\t\tresult = EEH_STATE_UNAVAILABLE;\n-\t\t\t} else {\n-\t\t\t\tresult = EEH_STATE_NOT_SUPPORT;\n-\t\t\t}\n-\t\t\tbreak;\n-\t\tdefault:\n+\tif (!rets[1])\n+\t\treturn EEH_STATE_NOT_SUPPORT;\n+\n+\tswitch(rets[0]) {\n+\tcase 0:\n+\t\tresult = EEH_STATE_MMIO_ACTIVE |\n+\t\t\t EEH_STATE_DMA_ACTIVE;\n+\t\tbreak;\n+\tcase 1:\n+\t\tresult = EEH_STATE_RESET_ACTIVE |\n+\t\t\t EEH_STATE_MMIO_ACTIVE  |\n+\t\t\t EEH_STATE_DMA_ACTIVE;\n+\t\tbreak;\n+\tcase 2:\n+\t\tresult = 0;\n+\t\tbreak;\n+\tcase 4:\n+\t\tresult = EEH_STATE_MMIO_ENABLED;\n+\t\tbreak;\n+\tcase 5:\n+\t\tif (rets[2]) {\n+\t\t\tif (state) *state = rets[2];\n+\t\t\tresult = EEH_STATE_UNAVAILABLE;\n+\t\t} else {\n \t\t\tresult = EEH_STATE_NOT_SUPPORT;\n \t\t}\n-\t} else {\n+\t\tbreak;\n+\tdefault:\n \t\tresult = EEH_STATE_NOT_SUPPORT;\n \t}\n \n",
    "prefixes": [
        "v2",
        "5/8"
    ]
}