Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/204/?format=api
{ "id": 204, "url": "http://patchwork.ozlabs.org/api/patches/204/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/1220856343-22799-1-git-send-email-gerickson@nuovations.com/", "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": "<1220856343-22799-1-git-send-email-gerickson@nuovations.com>", "list_archive_url": null, "date": "2008-09-08T06:45:43", "name": "nanddump: Use Boolean Mnemonics from stdbool.h", "commit_ref": "c5a2630fdb64ecb2991deb609a670b1c1a856905", "pull_url": null, "state": "accepted", "archived": false, "hash": "19d49d51d641a57dbc241fa5677239fd0c68eabb", "submitter": { "id": 115, "url": "http://patchwork.ozlabs.org/api/people/115/?format=api", "name": "Grant Erickson", "email": "gerickson@nuovations.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/1220856343-22799-1-git-send-email-gerickson@nuovations.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/204/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/204/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org>", "X-Original-To": "patchwork@ozlabs.org", "Delivered-To": "patchwork@ozlabs.org", "Received": [ "from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\tby ozlabs.org (Postfix) with ESMTPS id 3FAC1DDE1D\n\tfor <patchwork@ozlabs.org>; Mon, 8 Sep 2008 16:45:53 +1000 (EST)", "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KcaVP-00061I-2f; Mon, 08 Sep 2008 06:45:47 +0000", "from relay01.pair.com ([209.68.5.15])\n\tby bombadil.infradead.org with smtp (Exim 4.68 #1 (Red Hat Linux))\n\tid 1KcaVN-0005sh-LF\n\tfor linux-mtd@lists.infradead.org; Mon, 08 Sep 2008 06:45:45 +0000", "(qmail 2974 invoked by uid 0); 8 Sep 2008 06:45:44 -0000", "from unknown (HELO localhost.localdomain) (unknown)\n\tby unknown with SMTP; 8 Sep 2008 06:45:44 -0000" ], "X-pair-Authenticated": "66.134.71.115", "From": "Grant Erickson <gerickson@nuovations.com>", "To": "linux-mtd@lists.infradead.org", "Subject": "[PATCH 4/6] [MTD-UTILS] nanddump: Use Boolean Mnemonics from\n\tstdbool.h", "Date": "Sun, 7 Sep 2008 23:45:43 -0700", "Message-Id": "<1220856343-22799-1-git-send-email-gerickson@nuovations.com>", "X-Mailer": "git-send-email 1.6.0.1", "Organization": "Nuovation System Designs, LLC", "X-Spam-Score": "-1.0 (-)", "X-Spam-Report": "SpamAssassin version 3.2.5 on bombadil.infradead.org summary:\n\tContent analysis details: (-1.0 points)\n\tpts rule name description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-1.0 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/,\n\tlow trust [209.68.5.15 listed in list.dnswl.org]", "X-BeenThere": "linux-mtd@lists.infradead.org", "X-Mailman-Version": "2.1.9", "Precedence": "list", "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/listinfo/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>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "linux-mtd-bounces@lists.infradead.org", "Errors-To": "linux-mtd-bounces+patchwork=ozlabs.org@lists.infradead.org" }, "content": "Added include directive for stdbool.h and leveraged where appropriate\nto improve code readability by making variable intent and usage more\nexplicit.\n\nSigned-off-by: Grant Erickson <gerickson@nuovations.com>", "diff": "diff --git a/nanddump.c b/nanddump.c\nindex 168fbbb..44a1014 100644\n--- a/nanddump.c\n+++ b/nanddump.c\n@@ -17,6 +17,7 @@\n #include <ctype.h>\n #include <errno.h>\n #include <fcntl.h>\n+#include <stdbool.h>\n #include <stdio.h>\n #include <stdlib.h>\n #include <string.h>\n@@ -69,15 +70,15 @@ static void display_version (void)\n \n // Option variables\n \n-static int\t\tignoreerrors;\t// ignore errors\n-static int\t\tpretty_print;\t// print nice in ascii\n-static int\t\tnoecc;\t\t// don't error correct\n-static int\t\tomitoob;\t// omit oob data\n-static unsigned long\tstart_addr;\t// start address\n-static unsigned long\tlength;\t\t// dump length\n-static const char\t*mtddev;\t// mtd device name\n-static const char\t*dumpfile;\t// dump file name\n-static int\t\tomitbad;\n+static bool\t\tignoreerrors = false;\t// ignore errors\n+static bool\t\tpretty_print = false;\t// print nice in ascii\n+static bool\t\tnoecc = false;\t\t// don't error correct\n+static bool\t\tomitoob = false;\t// omit oob data\n+static unsigned long\tstart_addr;\t\t// start address\n+static unsigned long\tlength;\t\t\t// dump length\n+static const char\t*mtddev;\t\t// mtd device name\n+static const char\t*dumpfile;\t\t// dump file name\n+static bool\t\tomitbad = false;\n \n static void process_options (int argc, char * const argv[])\n {\n@@ -118,7 +119,7 @@ static void process_options (int argc, char * const argv[])\n \t\t\t\t}\n \t\t\t\tbreak;\n \t\t\tcase 'b':\n-\t\t\t\tomitbad = 1;\n+\t\t\t\tomitbad = true;\n \t\t\t\tbreak;\n \t\t\tcase 's':\n \t\t\t\tstart_addr = strtol(optarg, NULL, 0);\n@@ -130,22 +131,22 @@ static void process_options (int argc, char * const argv[])\n \t\t\t\t}\n \t\t\t\tbreak;\n \t\t\tcase 'i':\n-\t\t\t\tignoreerrors = 1;\n+\t\t\t\tignoreerrors = true;\n \t\t\t\tbreak;\n \t\t\tcase 'l':\n \t\t\t\tlength = strtol(optarg, NULL, 0);\n \t\t\t\tbreak;\n \t\t\tcase 'o':\n-\t\t\t\tomitoob = 1;\n+\t\t\t\tomitoob = true;\n \t\t\t\tbreak;\n \t\t\tcase 'p':\n-\t\t\t\tpretty_print = 1;\n+\t\t\t\tpretty_print = true;\n \t\t\t\tbreak;\n \t\t\tcase 'n':\n-\t\t\t\tnoecc = 1;\n+\t\t\t\tnoecc = true;\n \t\t\t\tbreak;\n \t\t\tcase '?':\n-\t\t\t\terror = 1;\n+\t\t\t\terror++;\n \t\t\t\tbreak;\n \t\t}\n \t}\n@@ -176,7 +177,7 @@ int main(int argc, char * const argv[])\n \tint oobinfochanged = 0 ;\n \tstruct nand_oobinfo old_oobinfo;\n \tstruct mtd_ecc_stats stat1, stat2;\n-\tint eccstats = 0;\n+\tbool eccstats = false;\n \n \tprocess_options(argc, argv);\n \n@@ -235,7 +236,7 @@ int main(int argc, char * const argv[])\n \n \t\t/* check if we can read ecc stats */\n \t\tif (!ioctl(fd, ECCGETSTATS, &stat1)) {\n-\t\t\teccstats = 1;\n+\t\t\teccstats = true;\n \t\t\tfprintf(stderr, \"ECC failed: %d\\n\", stat1.failed);\n \t\t\tfprintf(stderr, \"ECC corrected: %d\\n\", stat1.corrected); \n \t\t\tfprintf(stderr, \"Number of bad blocks: %d\\n\", stat1.badblocks); \n", "prefixes": [] }