From patchwork Fri Aug 19 17:07:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 110703 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BD00AB6F77 for ; Sat, 20 Aug 2011 03:10:34 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QuSZg-0001U6-RC; Fri, 19 Aug 2011 17:09:41 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QuSZe-0003rO-GC; Fri, 19 Aug 2011 17:09:38 +0000 Received: from mail-pz0-f41.google.com ([209.85.210.41]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QuSZ9-0003fN-H7 for linux-mtd@lists.infradead.org; Fri, 19 Aug 2011 17:09:10 +0000 Received: by mail-pz0-f41.google.com with SMTP id 4so7209431pzk.28 for ; Fri, 19 Aug 2011 10:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=o+I1tIhwYHiWKmHTRbQEqYPf8OIn2eAJpKjHYIg5YJs=; b=nEFzW3JBUkb+Fbtb/YPoRLPZ9HZeG03/edXJjJ2YrDLzldR6dw5i/Vr+ioyWpO0EPf BKrsu9O6KjP9eCDGG/ZFkmryyUkAw42JffvXk/+8V8M26ZxCjITN16btNY+Iwdeva0qm +C3MjRMBj/HLIc8iTE3a063hloMflJb8q6bXM= Received: by 10.142.207.19 with SMTP id e19mr500117wfg.312.1313773746899; Fri, 19 Aug 2011 10:09:06 -0700 (PDT) Received: from localhost.localdomain (cpe-76-174-190-12.socal.res.rr.com [76.174.190.12]) by mx.google.com with ESMTPS id f8sm2467499pbk.22.2011.08.19.10.09.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Aug 2011 10:09:05 -0700 (PDT) From: Brian Norris To: Artem Bityutskiy Subject: [PATCH 07/10] nandwrite: kill -j, -y, and -f options Date: Fri, 19 Aug 2011 10:07:53 -0700 Message-Id: <1313773676-12879-8-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1313773676-12879-1-git-send-email-computersforpeace@gmail.com> References: <1313773676-12879-1-git-send-email-computersforpeace@gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110819_130908_112739_38BEDD66 X-CRM114-Status: GOOD ( 17.53 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.41 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Kevin Cernekee , Brian Norris , linux-mtd@lists.infradead.org, Mike Frysinger X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The legacy -j (--jffs2) and -y (--yaffs) options haven't been operational for a long time, since MEMSETOOBSEL was killed. I don't think anybody will miss these options (correct me if I'm wrong). They can be replaced by proper usage of MTD_OOB_AUTO modes. The -f (--forcelegacy) option went hand in hand with -j and -y. Now that -j and -y are gone, there's no use for -f. Kill it. Signed-off-by: Brian Norris --- nandwrite.c | 60 +---------------------------------------------------------- 1 files changed, 1 insertions(+), 59 deletions(-) diff --git a/nandwrite.c b/nandwrite.c index 22e9b7f..a0f2596 100644 --- a/nandwrite.c +++ b/nandwrite.c @@ -43,29 +43,12 @@ #include "common.h" #include -// oob layouts to pass into the kernel as default -static struct nand_oobinfo jffs2_oobinfo = { - .useecc = MTD_NANDECC_PLACE, - .eccbytes = 6, - .eccpos = { 0, 1, 2, 3, 6, 7 } -}; - -static struct nand_oobinfo yaffs_oobinfo = { - .useecc = MTD_NANDECC_PLACE, - .eccbytes = 6, - .eccpos = { 8, 9, 10, 13, 14, 15} -}; - static void display_help(void) { printf( "Usage: nandwrite [OPTION] MTD_DEVICE [INPUTFILE|-]\n" "Writes to the specified MTD device.\n" "\n" -" -j, --jffs2 Force jffs2 oob layout (legacy support)\n" -" -y, --yaffs Force yaffs oob layout (legacy support)\n" -" -f, --forcelegacy Force legacy support on autoplacement-enabled mtd\n" -" device\n" " -m, --markbad Mark blocks bad if write fails\n" " -n, --noecc Write without ecc\n" " -N, --noskipbad Write without bad block skipping\n" @@ -106,9 +89,6 @@ static bool writeoob = false; static bool rawoob = false; static bool onlyoob = false; static bool markbad = false; -static bool forcejffs2 = false; -static bool forceyaffs = false; -static bool forcelegacy = false; static bool noecc = false; static bool noskipbad = false; static bool pad = false; @@ -120,13 +100,11 @@ static void process_options(int argc, char * const argv[]) for (;;) { int option_index = 0; - static const char *short_options = "b:fjmnNoOpqrs:y"; + static const char *short_options = "b:mnNoOpqrs:"; static const struct option long_options[] = { {"help", no_argument, 0, 0}, {"version", no_argument, 0, 0}, {"blockalign", required_argument, 0, 'b'}, - {"forcelegacy", no_argument, 0, 'f'}, - {"jffs2", no_argument, 0, 'j'}, {"markbad", no_argument, 0, 'm'}, {"noecc", no_argument, 0, 'n'}, {"noskipbad", no_argument, 0, 'N'}, @@ -136,7 +114,6 @@ static void process_options(int argc, char * const argv[]) {"quiet", no_argument, 0, 'q'}, {"raw", no_argument, 0, 'r'}, {"start", required_argument, 0, 's'}, - {"yaffs", no_argument, 0, 'y'}, {0, 0, 0, 0}, }; @@ -160,15 +137,6 @@ static void process_options(int argc, char * const argv[]) case 'q': quiet = true; break; - case 'j': - forcejffs2 = true; - break; - case 'y': - forceyaffs = true; - break; - case 'f': - forcelegacy = true; - break; case 'n': noecc = true; break; @@ -323,32 +291,6 @@ int main(int argc, char * const argv[]) } } - /* - * force oob layout for jffs2 or yaffs ? - * Legacy support - */ - if (forcejffs2 || forceyaffs) { - struct nand_oobinfo *oobsel = forcejffs2 ? &jffs2_oobinfo : &yaffs_oobinfo; - - if ((old_oobinfo.useecc == MTD_NANDECC_AUTOPLACE) && !forcelegacy) { - fprintf(stderr, "Use -f option to enforce legacy placement on autoplacement enabled mtd device\n"); - goto restoreoob; - } - if (mtd.oob_size == 8) { - if (forceyaffs) { - fprintf(stderr, "YAFSS cannot operate on 256 Byte page size"); - goto restoreoob; - } - /* Adjust number of ecc bytes */ - jffs2_oobinfo.eccbytes = 3; - } - - if (ioctl(fd, MEMSETOOBSEL, oobsel) != 0) { - perror("MEMSETOOBSEL"); - goto restoreoob; - } - } - /* Determine if we are reading from standard input or from a file. */ if (strcmp(img, standard_input) == 0) { ifd = STDIN_FILENO;