get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 807595,
    "url": "http://patchwork.ozlabs.org/api/patches/807595/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170830112145.26586-1-u.kleine-koenig@pengutronix.de/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api",
        "name": "Linux MTD development",
        "link_name": "linux-mtd",
        "list_id": "linux-mtd.lists.infradead.org",
        "list_email": "linux-mtd@lists.infradead.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170830112145.26586-1-u.kleine-koenig@pengutronix.de>",
    "list_archive_url": null,
    "date": "2017-08-30T11:21:45",
    "name": "[mtd-utils,v2] nandmarkbad: new util to mark blocks as bad",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "167b950e59b049036fc119241a13ec47fe9bf12f",
    "submitter": {
        "id": 1476,
        "url": "http://patchwork.ozlabs.org/api/people/1476/?format=api",
        "name": "Uwe Kleine-König",
        "email": "u.kleine-koenig@pengutronix.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170830112145.26586-1-u.kleine-koenig@pengutronix.de/mbox/",
    "series": [
        {
            "id": 591,
            "url": "http://patchwork.ozlabs.org/api/series/591/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=591",
            "date": "2017-08-30T11:21:45",
            "name": "[mtd-utils,v2] nandmarkbad: new util to mark blocks as bad",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/591/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/807595/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/807595/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"K1S6iWop\"; \n\tdkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xj35y0gNrz9sNn\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 21:23:18 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dn15Q-0003Th-8l; Wed, 30 Aug 2017 11:23:08 +0000",
            "from metis.ext.pengutronix.de\n\t([2001:67c:670:201:290:27ff:fe1d:cc33])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dn14x-0003PL-K1\n\tfor linux-mtd@lists.infradead.org; Wed, 30 Aug 2017 11:22:43 +0000",
            "from [2001:67c:670:100:5054:ff:fe2a:3aa]\n\t(helo=pty.hi.pengutronix.de)\n\tby metis.ext.pengutronix.de with esmtps\n\t(TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2)\n\t(envelope-from <ukl@pengutronix.de>)\n\tid 1dn14V-0003Tn-AG; Wed, 30 Aug 2017 13:22:11 +0200",
            "from ukl by pty.hi.pengutronix.de with local (Exim 4.89)\n\t(envelope-from <ukl@pengutronix.de>)\n\tid 1dn14R-0007g6-IA; Wed, 30 Aug 2017 13:22:07 +0200"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:\n\tIn-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=Wq1XJqEWDSQamTe/rO97Ja+2AZDHNyc3tVop7OYGcO8=;\n\tb=K1S6iWopxDy2QDDpE6Wg055bnb\n\tKD9W6bccEN2yswdsiAgzOfGDTUT37wVM/zzdY0vUjltonu7LfBlVXGrJYZcSy3rvEnyvgoI+gYEmF\n\t6vXXYQmLVm4gunQT1JjfvZ0Z6rfwHrWO9Wdf8F541SDqmMWHUnmSoWK/oPcU1EVB8lh6MDHAKoF56\n\txQR4Kw70qgqXepT8xnK6GKKhG7ODudc++rgmYhsFGIpcLEizZfWXtTq91zsz3entHZ5Tfqh6fv3XX\n\t7BJ3HX7IF6H8fIl918vznIL4C66ZLet5U+xDD1sCyZqPQMVNrWY90ZlihieDJIOqcPE61jn9Sxmu9\n\tTnnWG/2Q==;",
        "From": "=?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>",
        "To": "David Oberhollenzer <david.oberhollenzer@sigma-star.at>",
        "Subject": "[PATCH mtd-utils v2] nandmarkbad: new util to mark blocks as bad",
        "Date": "Wed, 30 Aug 2017 13:21:45 +0200",
        "Message-Id": "<20170830112145.26586-1-u.kleine-koenig@pengutronix.de>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-Reply-To": "<20170824152227.30394-1-ukleinek@debian.org>",
        "References": "<20170824152227.30394-1-ukleinek@debian.org>",
        "X-SA-Exim-Connect-IP": "2001:67c:670:100:5054:ff:fe2a:3aa",
        "X-SA-Exim-Mail-From": "ukl@pengutronix.de",
        "X-SA-Exim-Scanned": "No (on metis.ext.pengutronix.de);\n\tSAEximRunCond expanded to false",
        "X-PTX-Original-Recipient": "linux-mtd@lists.infradead.org",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20170830_042239_957325_D34F48FC ",
        "X-CRM114-Status": "GOOD (  17.53  )",
        "X-Spam-Score": "-1.9 (-)",
        "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>",
        "List-Post": "<mailto:linux-mtd@lists.infradead.org>",
        "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Cc": "Richard Weinberger <richard@nod.at>, linux-mtd@lists.infradead.org,\n\tkernel@pengutronix.de",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "---\nchanges since (implicit) v1 sent with Message-Id: 20170824152227.30394-1-ukleinek@debian.org:\n\n - fix printf format resulting in crash\n   (suggested by gcc and David Oberhollenzer)\n - add options --help, --version, -V (suggested by David Oberhollenzer)\n - add options --i-know-what-i-do, -y (suggested by Richard Weinberger)\n - add an error message if no device was given\n - make usage static\n - use right author email address\n\n .gitignore               |  1 +\n nand-utils/Makemodule.am |  5 ++-\n nand-utils/nandmarkbad.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 100 insertions(+), 1 deletion(-)\n create mode 100644 nand-utils/nandmarkbad.c",
    "diff": "diff --git a/.gitignore b/.gitignore\nindex 38bd04deb34e..754da97b43bf 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -36,6 +36,7 @@ mkfs.jffs2\n mtd_debug\n mtdpart\n nanddump\n+nandmarkbad\n nandtest\n nandwrite\n nftl_format\ndiff --git a/nand-utils/Makemodule.am b/nand-utils/Makemodule.am\nindex d75b0cb3e36c..c31dcb01f06e 100644\n--- a/nand-utils/Makemodule.am\n+++ b/nand-utils/Makemodule.am\n@@ -7,6 +7,9 @@ nandwrite_LDADD = libmtd.a\n nandtest_SOURCES = nand-utils/nandtest.c\n nandtest_LDADD = libmtd.a\n \n+nandmarkbad_SOURCES = nand-utils/nandmarkbad.c\n+nandmarkbad_LDADD = libmtd.a\n+\n nftldump_SOURCES = nand-utils/nftldump.c\n nftldump_LDADD = libmtd.a\n \n@@ -14,7 +17,7 @@ nftl_format_SOURCES = nand-utils/nftl_format.c\n nftl_format_LDADD = libmtd.a\n \n NAND_BINS = \\\n-\tnanddump nandwrite nandtest nftldump nftl_format\n+\tnanddump nandwrite nandtest nandmarkbad nftldump nftl_format\n \n NAND_SH = \\\n \tnand-utils/load_nandsim.sh\ndiff --git a/nand-utils/nandmarkbad.c b/nand-utils/nandmarkbad.c\nnew file mode 100644\nindex 000000000000..023bdbe50c4d\n--- /dev/null\n+++ b/nand-utils/nandmarkbad.c\n@@ -0,0 +1,95 @@\n+#define PROGRAM_NAME \"nandmarkbad\"\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <unistd.h>\n+#include <getopt.h>\n+\n+#include \"common.h\"\n+#include <libmtd.h>\n+\n+void usage(int status)\n+{\n+\tfprintf(status ? stderr : stdout,\n+\t\t\"usage: %s [OPTIONS] <device>\\n\\n\"\n+\t\t\"  -b, --markbad=blockno        Mark block bad\\n\"\n+\t\tPROGRAM_NAME);\n+\texit(status);\n+}\n+\n+/*\n+ * Main program\n+ */\n+int main(int argc, char **argv)\n+{\n+\tloff_t mark_bad[32];\n+\tunsigned cnt_bad = 0;\n+\tstruct mtd_dev_info mtd;\n+\tlibmtd_t mtd_desc;\n+\tint fd;\n+\tint error = 0;\n+\tint ret;\n+\tunsigned int i;\n+\n+\tfor (;;) {\n+\t\tstatic const char short_options[] = \"b:h\";\n+\t\tstatic const struct option long_options[] = {\n+\t\t\t{ \"markbad\", required_argument, 0, 'b' },\n+\t\t\t{0, 0, 0, 0},\n+\t\t};\n+\t\tint option_index = 0;\n+\t\tint c = getopt_long(argc, argv, short_options, long_options,\n+\t\t\t\t    &option_index);\n+\t\tif (c == EOF)\n+\t\t\tbreak;\n+\n+\t\tswitch (c) {\n+\t\tcase 'h':\n+\t\t\tusage(EXIT_SUCCESS);\n+\t\t\tbreak;\n+\t\tcase '?':\n+\t\t\tusage(EXIT_FAILURE);\n+\t\t\tbreak;\n+\n+\t\tcase 'b':\n+\t\t\tif (cnt_bad < ARRAY_SIZE(mark_bad)) {\n+\t\t\t\tmark_bad[cnt_bad] =\n+\t\t\t\t\tsimple_strtoll(optarg, &error);\n+\t\t\t\t++cnt_bad;\n+\t\t\t} else {\n+\t\t\t\terrmsg_die(\"Can't handle so many bad blocks\\n\");\n+\t\t\t}\n+\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\targc -= optind;\n+\targv += optind;\n+\n+\tif (argc != 1 || error)\n+\t\tusage(EXIT_FAILURE);\n+\n+\tif (!cnt_bad)\n+\t\terrmsg_die(\"You must specify at least one block to mark bad\\n\");\n+\n+\tfd = open(argv[0], O_RDWR);\n+\tif (fd < 0)\n+\t\tsys_errmsg_die(\"Failed to open mtd device\\n\");\n+\n+\tmtd_desc = libmtd_open();\n+\tif (!mtd_desc)\n+\t\terrmsg_die(\"Can't initialize libmtd\");\n+\n+\tif (mtd_get_dev_info(mtd_desc, argv[0], &mtd) < 0)\n+\t\terrmsg_die(\"mtd_get_dev_info failed\");\n+\n+\tfor (i = 0; i < cnt_bad; ++i) {\n+\t\tret = mtd_mark_bad(&mtd, fd, mark_bad[i]);\n+\t\tif (ret)\n+\t\t\tsys_errmsg_die(\"%s: MTD Mark bad block failure\",\n+\t\t\t\t       argv[0]);\n+\t}\n+\n+\treturn EXIT_SUCCESS;\n+}\n",
    "prefixes": [
        "mtd-utils",
        "v2"
    ]
}