From patchwork Fri Aug 19 17:07:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 110709 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 0C2E1B6F62 for ; Sat, 20 Aug 2011 03:22:55 +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 1QuSm9-0003U7-PK; Fri, 19 Aug 2011 17:22:34 +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 1QuSm9-0004Lp-At; Fri, 19 Aug 2011 17:22:33 +0000 Received: from mail-yi0-f49.google.com ([209.85.218.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QuSm1-0004KC-U2 for linux-mtd@lists.infradead.org; Fri, 19 Aug 2011 17:22:26 +0000 Received: by yic13 with SMTP id 13so2681364yic.36 for ; Fri, 19 Aug 2011 10:22:24 -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=XpWXjn1GPgjMjqFgMeViPoGyZji2Sg/Ht8K05NtF1zM=; b=NbEGN6IFoM7wvsxg24jGKMWBkY7zoDzp8jS6OufGSO6CEx5Ijf7WOwbJ7QNZJVnho4 LLwX2sxz27e5o+HitAhdRZG3spO7UcvfpMdqKDjT7cWaj6wvUbPy8UHbvmpXk4vxwCql EJV89mgLV8iNqLQ3y7vHROsEXqkSbC1sf436E= Received: by 10.142.171.7 with SMTP id t7mr506309wfe.445.1313773744588; Fri, 19 Aug 2011 10:09:04 -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.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Aug 2011 10:09:03 -0700 (PDT) From: Brian Norris To: Artem Bityutskiy Subject: [PATCH 06/10] nandwrite: kill more MEMSETOOBSEL Date: Fri, 19 Aug 2011 10:07:52 -0700 Message-Id: <1313773676-12879-7-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_132226_216069_11ECB1A5 X-CRM114-Status: GOOD ( 11.35 ) 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.218.49 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 Signed-off-by: Brian Norris --- nandwrite.c | 26 +------------------------- 1 files changed, 1 insertions(+), 25 deletions(-) diff --git a/nandwrite.c b/nandwrite.c index 2700975..22e9b7f 100644 --- a/nandwrite.c +++ b/nandwrite.c @@ -44,10 +44,6 @@ #include // oob layouts to pass into the kernel as default -static struct nand_oobinfo none_oobinfo = { - .useecc = MTD_NANDECC_OFF, -}; - static struct nand_oobinfo jffs2_oobinfo = { .useecc = MTD_NANDECC_PLACE, .eccbytes = 6, @@ -318,18 +314,7 @@ int main(int argc, char * const argv[]) } else { switch (errno) { case ENOTTY: - if (ioctl(fd, MEMGETOOBSEL, &old_oobinfo) != 0) { - perror("MEMGETOOBSEL"); - close(fd); - exit(EXIT_FAILURE); - } - if (ioctl(fd, MEMSETOOBSEL, &none_oobinfo) != 0) { - perror("MEMSETOOBSEL"); - close(fd); - exit(EXIT_FAILURE); - } - oobinfochanged = 1; - break; + errmsg_die("ioctl MTDFILEMODE is missing"); default: perror("MTDFILEMODE"); close(fd); @@ -670,15 +655,6 @@ restoreoob: libmtd_close(mtd_desc); free(filebuf); free(oobbuf); - - if (oobinfochanged == 1) { - if (ioctl(fd, MEMSETOOBSEL, &old_oobinfo) != 0) { - perror("MEMSETOOBSEL"); - close(fd); - exit(EXIT_FAILURE); - } - } - close(fd); if (failed