get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 811393,
    "url": "http://patchwork.ozlabs.org/api/patches/811393/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/fwts/patch/1504861633-20512-1-git-send-email-alex.hung@canonical.com/",
    "project": {
        "id": 24,
        "url": "http://patchwork.ozlabs.org/api/projects/24/?format=api",
        "name": "Firmware Test Suite development",
        "link_name": "fwts",
        "list_id": "fwts-devel.lists.ubuntu.com",
        "list_email": "fwts-devel@lists.ubuntu.com",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1504861633-20512-1-git-send-email-alex.hung@canonical.com>",
    "list_archive_url": null,
    "date": "2017-09-08T09:07:11",
    "name": "[1/3] lib: fwts_acpi_tables: add a new function to check reserved bits",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "c698018a391e109600d4d0b128ac4c41c3d83417",
    "submitter": {
        "id": 10593,
        "url": "http://patchwork.ozlabs.org/api/people/10593/?format=api",
        "name": "Alex Hung",
        "email": "alex.hung@canonical.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/fwts/patch/1504861633-20512-1-git-send-email-alex.hung@canonical.com/mbox/",
    "series": [
        {
            "id": 2142,
            "url": "http://patchwork.ozlabs.org/api/series/2142/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/fwts/list/?series=2142",
            "date": "2017-09-08T09:07:11",
            "name": "[1/3] lib: fwts_acpi_tables: add a new function to check reserved bits",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2142/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/811393/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/811393/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<fwts-devel-bounces@lists.ubuntu.com>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=fwts-devel-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xpWg041jXz9s0g;\n\tFri,  8 Sep 2017 19:07:24 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.86_2)\n\t(envelope-from <fwts-devel-bounces@lists.ubuntu.com>)\n\tid 1dqFFx-0000oI-SQ; Fri, 08 Sep 2017 09:07:21 +0000",
            "from youngberry.canonical.com ([91.189.89.112])\n\tby huckleberry.canonical.com with esmtps\n\t(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128)\n\t(Exim 4.86_2) (envelope-from <alex.hung@canonical.com>)\n\tid 1dqFFx-0000oB-0f\n\tfor fwts-devel@lists.ubuntu.com; Fri, 08 Sep 2017 09:07:21 +0000",
            "from 1.general.alexhung.us.vpn ([10.172.65.254] helo=canonical.com)\n\tby youngberry.canonical.com with esmtpsa\n\t(TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76)\n\t(envelope-from <alex.hung@canonical.com>)\n\tid 1dqFFw-00015L-Gx; Fri, 08 Sep 2017 09:07:20 +0000"
        ],
        "From": "Alex Hung <alex.hung@canonical.com>",
        "To": "fwts-devel@lists.ubuntu.com",
        "Subject": "[PATCH 1/3] lib: fwts_acpi_tables: add a new function to check\n\treserved bits",
        "Date": "Fri,  8 Sep 2017 02:07:11 -0700",
        "Message-Id": "<1504861633-20512-1-git-send-email-alex.hung@canonical.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "X-BeenThere": "fwts-devel@lists.ubuntu.com",
        "X-Mailman-Version": "2.1.20",
        "Precedence": "list",
        "List-Id": "Firmware Test Suite Development <fwts-devel.lists.ubuntu.com>",
        "List-Unsubscribe": "<https://lists.ubuntu.com/mailman/options/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=unsubscribe>",
        "List-Archive": "<https://lists.ubuntu.com/archives/fwts-devel>",
        "List-Post": "<mailto:fwts-devel@lists.ubuntu.com>",
        "List-Help": "<mailto:fwts-devel-request@lists.ubuntu.com?subject=help>",
        "List-Subscribe": "<https://lists.ubuntu.com/mailman/listinfo/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "fwts-devel-bounces@lists.ubuntu.com",
        "Sender": "\"fwts-devel\" <fwts-devel-bounces@lists.ubuntu.com>"
    },
    "content": "Signed-off-by: Alex Hung <alex.hung@canonical.com>\n---\n src/lib/include/fwts_acpi_tables.h |  1 +\n src/lib/src/fwts_acpi_tables.c     | 52 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 53 insertions(+)",
    "diff": "diff --git a/src/lib/include/fwts_acpi_tables.h b/src/lib/include/fwts_acpi_tables.h\nindex d478d99..011a4c3 100644\n--- a/src/lib/include/fwts_acpi_tables.h\n+++ b/src/lib/include/fwts_acpi_tables.h\n@@ -54,6 +54,7 @@ bool fwts_acpi_obj_find(fwts_framework *fw, const char *obj_name);\n fwts_bool fwts_acpi_is_reduced_hardware(const fwts_acpi_table_fadt *fadt);\n \n void fwts_acpi_reserved_zero_check(fwts_framework *fw, const char *table, const char *field, uint64_t value, uint8_t size, bool *passed);\n+void fwts_acpi_reserved_bits_check(fwts_framework *fw, const char *table, const char *field, uint64_t value, uint8_t size, uint8_t min, uint8_t max, bool *passed);\n \n #endif\n \ndiff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c\nindex 4ac70f8..15d07f4 100644\n--- a/src/lib/src/fwts_acpi_tables.c\n+++ b/src/lib/src/fwts_acpi_tables.c\n@@ -1426,4 +1426,56 @@ void fwts_acpi_reserved_zero_check(\n \t}\n }\n \n+/*\n+ *  fwts_acpi_reserved_bits_check()\n+ *  verify whether the reserved bits are zero\n+ */\n+void fwts_acpi_reserved_bits_check(\n+\tfwts_framework *fw,\n+\tconst char *table,\n+\tconst char *field,\n+\tuint64_t value,\n+\tuint8_t size,\n+\tuint8_t min,\n+\tuint8_t max,\n+\tbool *passed)\n+{\n+\tuint64_t mask = 0;\n+\tuint8_t i;\n+\n+\tfor (i = min; i <= max; i++) {\n+\t\tmask |= (1ULL << i);\n+\t}\n+\n+\tif (value & mask) {\n+\t\tchar label[24];\n+\t\tstrncpy(label, table, 4);\t/* ACPI table name is 4 char long */\n+\t\tstrncpy(label + 4, \"ReservedBitsNonZero\", sizeof(label) - 4);\n+\n+\t\tswitch (size) {\n+\t\tcase sizeof(uint8_t):\n+\t\t\tfwts_failed(fw, LOG_LEVEL_HIGH, label,\n+\t\t\t\t\"%4.4s %s Bits [%\" PRIu8 \"..%\" PRIu8 \"] must be zero, got \"\n+\t\t\t\t\"0x%2.2\" PRIx8 \" instead\", table, field, max, min, (uint8_t)value);\n+\t\t\tbreak;\n+\t\tcase sizeof(uint16_t):\n+\t\t\tfwts_failed(fw, LOG_LEVEL_HIGH, label,\n+\t\t\t\t\"%4.4s %s Bits [%\" PRIu8 \"..%\" PRIu8 \"] must be zero, got \"\n+\t\t\t\t\"0x%4.4\" PRIx16 \" instead\", table, field, max, min, (uint16_t)value);\n+\t\t\tbreak;\n+\t\tcase sizeof(uint32_t):\n+\t\t\tfwts_failed(fw, LOG_LEVEL_HIGH, label,\n+\t\t\t\t\"%4.4s %s Bits [%\" PRIu8 \"..%\" PRIu8 \"] must be zero, got \"\n+\t\t\t\t\"0x%8.8\" PRIx32 \" instead\", table, field, max, min, (uint32_t)value);\n+\t\t\tbreak;\n+\t\tcase sizeof(uint64_t):\n+\t\t\tfwts_failed(fw, LOG_LEVEL_HIGH, label,\n+\t\t\t\t\"%4.4s %s Bits [%\" PRIu8 \"..%\" PRIu8 \"] must be zero, got \"\n+\t\t\t\t\"0x%16.16\" PRIx64 \" instead\", table, field, max, min, value);\n+\t\t\tbreak;\n+\t\t}\n+\t\t*passed = false;\n+\t}\n+}\n+\n #endif\n",
    "prefixes": [
        "1/3"
    ]
}