get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 808052,
    "url": "http://patchwork.ozlabs.org/api/patches/808052/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/skiboot/patch/1504161961-12190-5-git-send-email-cclaudio@linux.vnet.ibm.com/",
    "project": {
        "id": 44,
        "url": "http://patchwork.ozlabs.org/api/projects/44/?format=api",
        "name": "skiboot firmware development",
        "link_name": "skiboot",
        "list_id": "skiboot.lists.ozlabs.org",
        "list_email": "skiboot@lists.ozlabs.org",
        "web_url": "http://github.com/open-power/skiboot",
        "scm_url": "http://github.com/open-power/skiboot",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1504161961-12190-5-git-send-email-cclaudio@linux.vnet.ibm.com>",
    "list_archive_url": null,
    "date": "2017-08-31T06:45:52",
    "name": "[04/13] libstb: rename rom_driver_ops struct to container_verification_code",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "4b38c17216b310541a49d10108d46af6ffea595d",
    "submitter": {
        "id": 69305,
        "url": "http://patchwork.ozlabs.org/api/people/69305/?format=api",
        "name": "Claudio Carvalho",
        "email": "cclaudio@linux.vnet.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/skiboot/patch/1504161961-12190-5-git-send-email-cclaudio@linux.vnet.ibm.com/mbox/",
    "series": [
        {
            "id": 754,
            "url": "http://patchwork.ozlabs.org/api/series/754/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/skiboot/list/?series=754",
            "date": "2017-08-31T06:45:48",
            "name": "libstb: simplify the initialization of cvc drivers",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/754/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/808052/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/808052/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "skiboot@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "skiboot@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjXx74Fqdz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 16:47:23 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xjXx73HlgzDqZ9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 16:47:23 +1000 (AEST)",
            "from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xjXvy53GzzDqV5\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 16:46:22 +1000 (AEST)",
            "from pps.filterd (m0098414.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7V6hoO8126156\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 02:46:20 -0400",
            "from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2cp6sd7fhp-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 02:46:20 -0400",
            "from localhost\n\tby e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <skiboot@lists.ozlabs.org> from <cclaudio@linux.vnet.ibm.com>;\n\tThu, 31 Aug 2017 00:46:19 -0600",
            "from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15)\n\tby e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 31 Aug 2017 00:46:17 -0600",
            "from b03ledav004.gho.boulder.ibm.com\n\t(b03ledav004.gho.boulder.ibm.com [9.17.130.235])\n\tby b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v7V6kGWJ4129088\n\tfor <skiboot@lists.ozlabs.org>; Wed, 30 Aug 2017 23:46:16 -0700",
            "from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 88D2678051\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 00:46:16 -0600 (MDT)",
            "from legolas.ibm.com (unknown [9.85.193.48])\n\tby b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id DE8FE78043\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 00:46:15 -0600 (MDT)"
        ],
        "From": "Claudio Carvalho <cclaudio@linux.vnet.ibm.com>",
        "To": "skiboot@lists.ozlabs.org",
        "Date": "Thu, 31 Aug 2017 03:45:52 -0300",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1504161961-12190-1-git-send-email-cclaudio@linux.vnet.ibm.com>",
        "References": "<1504161961-12190-1-git-send-email-cclaudio@linux.vnet.ibm.com>",
        "X-TM-AS-GCONF": "00",
        "x-cbid": "17083106-0008-0000-0000-000008805F5D",
        "X-IBM-SpamModules-Scores": "",
        "X-IBM-SpamModules-Versions": "BY=3.00007640; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00910084; UDB=6.00456503;\n\tIPR=6.00690365; \n\tBA=6.00005562; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016938;\n\tXFM=3.00000015; UTC=2017-08-31 06:46:17",
        "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused",
        "x-cbparentid": "17083106-0009-0000-0000-000043C864A9",
        "Message-Id": "<1504161961-12190-5-git-send-email-cclaudio@linux.vnet.ibm.com>",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-31_01:, , signatures=0",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=1\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1708310102",
        "Subject": "[Skiboot] [PATCH 04/13] libstb: rename rom_driver_ops struct to\n\tcontainer_verification_code",
        "X-BeenThere": "skiboot@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.23",
        "Precedence": "list",
        "List-Id": "Mailing list for skiboot development <skiboot.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/skiboot/>",
        "List-Post": "<mailto:skiboot@lists.ozlabs.org>",
        "List-Help": "<mailto:skiboot-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Skiboot\"\n\t<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"
    },
    "content": "This just gives a better name to the rom_driver_ops structure.\n\nSigned-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>\n---\n libstb/drivers/romcode.c   |  4 ++--\n libstb/drivers/sw_driver.c |  4 ++--\n libstb/rom.c               | 22 +++++++++++-----------\n libstb/rom.h               |  6 +++---\n libstb/stb.c               | 22 ++++++++++------------\n 5 files changed, 28 insertions(+), 30 deletions(-)",
    "diff": "diff --git a/libstb/drivers/romcode.c b/libstb/drivers/romcode.c\nindex 94bd42c..68f1230 100644\n--- a/libstb/drivers/romcode.c\n+++ b/libstb/drivers/romcode.c\n@@ -81,7 +81,7 @@ static void romcode_cleanup(void) {\n \thw_key_hash = NULL;\n }\n \n-static struct rom_driver_ops romcode_driver = {\n+static struct container_verification_code c1vc = {\n \t.name    = DRIVER_NAME,\n \t.verify  = romcode_verify,\n \t.sha512  = romcode_sha512,\n@@ -134,5 +134,5 @@ void romcode_probe(const struct dt_node *node)\n \t * the ROM code or set the memory region as executable.\n          * skiboot accesses the physical memory directly. Real mode.\n \t */\n-\trom_set_driver(&romcode_driver);\n+\trom_set_driver(&c1vc);\n }\ndiff --git a/libstb/drivers/sw_driver.c b/libstb/drivers/sw_driver.c\nindex e7f3740..55224a2 100644\n--- a/libstb/drivers/sw_driver.c\n+++ b/libstb/drivers/sw_driver.c\n@@ -44,7 +44,7 @@ static void stb_software_cleanup(void)\n \treturn;\n }\n \n-static struct rom_driver_ops sw_driver = {\n+static struct container_verification_code c1vc = {\n \t.name    = \"software\",\n \t.verify  = stb_software_verify,\n \t.sha512  = stb_software_sha512,\n@@ -72,5 +72,5 @@ void stb_software_probe(const struct dt_node *node)\n \t}\n \thw_key_hash = (sha2_hash_t*) dt_prop_get(node, \"hw-key-hash\");\n \n-\trom_set_driver(&sw_driver);\n+\trom_set_driver(&c1vc);\n }\ndiff --git a/libstb/rom.c b/libstb/rom.c\nindex 5f9abd2..27b65c9 100644\n--- a/libstb/rom.c\n+++ b/libstb/rom.c\n@@ -19,37 +19,37 @@\n #include \"drivers/romcode.h\"\n #include \"drivers/sw_driver.h\"\n \n-static struct rom_driver_ops *rom_driver = NULL;\n+static struct container_verification_code *c1vc = NULL;\n \n-struct rom_driver_ops* rom_init(const struct dt_node *node __unused)\n+struct container_verification_code* rom_init(const struct dt_node *node __unused)\n {\n-\tif (rom_driver)\n+\tif (c1vc)\n \t\tgoto end;\n \n \t/* ROM drivers supported */\n \tromcode_probe(node);\n \n-\tif (!rom_driver)\n+\tif (!c1vc)\n \t\tstb_software_probe(node);\n \n-\tif (!rom_driver)\n+\tif (!c1vc)\n \t\tprlog(PR_NOTICE, \"ROM: no rom driver found\\n\");\n end:\n-\treturn rom_driver;\n+\treturn c1vc;\n }\n \n-void rom_set_driver(struct rom_driver_ops *driver)\n+void rom_set_driver(struct container_verification_code *driver)\n {\n-\tif (rom_driver) {\n+\tif (c1vc) {\n \t\t/**\n \t\t * @fwts-label ROMAlreadyRegistered\n \t\t * @fwts-advice ibm,secureboot already registered. Check if\n \t\t * rom_init called twice or the same driver is probed twice\n \t\t */\n \t\tprlog(PR_WARNING, \"ROM: %s driver already registered\\n\",\n-\t\t      driver->name);\n+\t\t      c1vc->name);\n \t\treturn;\n \t}\n-\trom_driver = driver;\n-\tprlog(PR_NOTICE, \"ROM: %s driver registered\\n\", driver->name);\n+\tc1vc = driver;\n+\tprlog(PR_NOTICE, \"ROM: %s driver registered\\n\", c1vc->name);\n }\ndiff --git a/libstb/rom.h b/libstb/rom.h\nindex e1a7497..972a19b 100644\n--- a/libstb/rom.h\n+++ b/libstb/rom.h\n@@ -22,7 +22,7 @@\n #include <stdlib.h>\n #include \"container.h\"\n \n-struct rom_driver_ops {\n+struct container_verification_code {\n \tconst char* name;\n \tint  (*verify)(void *container);\n \tvoid (*sha512)(const uint8_t *data, size_t len, uint8_t *digest);\n@@ -33,11 +33,11 @@ struct rom_driver_ops {\n  * Load a compatible driver to access the functions of the\n  * verification code flashed in the secure ROM\n  */\n-extern struct rom_driver_ops* rom_init(const struct dt_node *node);\n+extern struct container_verification_code* rom_init(const struct dt_node *node);\n \n /*\n  * Set the rom driver that will be used\n  */\n-extern void rom_set_driver(struct rom_driver_ops *driver);\n+extern void rom_set_driver(struct container_verification_code *driver);\n \n #endif /* __ROM_H */\ndiff --git a/libstb/stb.c b/libstb/stb.c\nindex ed34c6a..eb77038 100644\n--- a/libstb/stb.c\n+++ b/libstb/stb.c\n@@ -32,7 +32,7 @@\n static bool secure_mode = false;\n static bool trusted_mode = false;\n \n-static struct rom_driver_ops *rom_driver = NULL;\n+static struct container_verification_code *c1vc = NULL;\n \n /*\n  * This maps a PCR for each resource we can measure. The PCR number is\n@@ -124,8 +124,8 @@ void stb_init(void)\n \n \tif (!secure_mode && !trusted_mode)\n \t\treturn;\n-\trom_driver = rom_init(ibm_secureboot);\n-\tif (secure_mode && !rom_driver) {\n+\tc1vc = rom_init(ibm_secureboot);\n+\tif (secure_mode && !c1vc) {\n \t\tprlog(PR_EMERG, \"STB: compatible romcode driver not found\\n\");\n \t\tsb_enforce();\n \t}\n@@ -167,9 +167,8 @@ int stb_final(void)\n \t\t}\n \t\ttpm_add_status_property();\n \t}\n-\tif (rom_driver) {\n-\t\trom_driver->cleanup();\n-\t\trom_driver = NULL;\n+\tif (c1vc) {\n+\t\tc1vc = NULL;\n \t}\n \ttpm_cleanup();\n \tsecure_mode = false;\n@@ -235,9 +234,8 @@ int tb_measure(enum resource_id id, void *buf, size_t len)\n \t\t\tabort();\n \t\t}\n \n-\t\trom_driver->sha512(\n-\t\t\t      (void*)((uint8_t*)buf + SECURE_BOOT_HEADERS_SIZE),\n-\t\t\t      len - SECURE_BOOT_HEADERS_SIZE, digest);\n+\t\tc1vc->sha512((void*) buf + SECURE_BOOT_HEADERS_SIZE,\n+\t\t\t\t   len - SECURE_BOOT_HEADERS_SIZE, digest);\n \n \t\tprlog(PR_INFO, \"STB: %s sha512 hash re-calculated\\n\", name);\n \t\tif (memcmp(digestp, digest, TPM_ALG_SHA256_SIZE) != 0) {\n@@ -251,7 +249,7 @@ int tb_measure(enum resource_id id, void *buf, size_t len)\n \t\t\t\tabort();\n \t\t}\n \t} else {\n-\t\trom_driver->sha512(buf, len, digest);\n+\t\tc1vc->sha512(buf, len, digest);\n \t\tprlog(PR_INFO, \"STB: %s sha512 hash calculated\\n\", name);\n \t}\n \n@@ -287,7 +285,7 @@ int sb_verify(enum resource_id id, void *buf, size_t len)\n \t\t      \"resource_id=%d unknown\\n\", id);\n \t\tsb_enforce();\n \t}\n-\tif (!rom_driver || !rom_driver->verify) {\n+\tif (!c1vc || !c1vc->verify) {\n \t\tprlog(PR_EMERG, \"STB: secure boot not initialized\\n\");\n \t\tsb_enforce();\n \t}\n@@ -296,7 +294,7 @@ int sb_verify(enum resource_id id, void *buf, size_t len)\n \t\t      __func__, id, buf, len);\n \t\tsb_enforce();\n \t}\n-\tif (rom_driver->verify(buf)) {\n+\tif (c1vc->verify(buf)) {\n \t\tprlog(PR_EMERG, \"STB: %s failed: resource %s, \"\n \t\t      \"eyecatcher 0x%016llx\\n\", __func__, name,\n \t\t      *((uint64_t*)buf));\n",
    "prefixes": [
        "04/13"
    ]
}