All of lore.kernel.org
 help / color / mirror / Atom feed
* little mistake in nandwrite.c
@ 2005-01-07 20:29 Michael
  0 siblings, 0 replies; only message in thread
From: Michael @ 2005-01-07 20:29 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

Hi.
I'm pretty sure I've found a small mistake in 'nandwrite.c'.

Relevant code block:  (mistake is 5 lines in)

        // force oob layout for jffs2 or yaffs ?
        if (forcejffs2 || forceyaffs) {
                struct nand_oobinfo *oobsel = forcejffs2 ?
&jffs2_oobinfo : &yaffs_oobinfo;

                if (forceyaffs && meminfo.oobsize == 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;
                }
        }

Patch is attached.

[-- Attachment #2: nandwrite.c_patch --]
[-- Type: application/octet-stream, Size: 439 bytes --]

--- nandwrite.c.orig	2005-01-07 14:22:54.000000000 -0600
+++ nandwrite.c	2005-01-07 14:23:10.000000000 -0600
@@ -271,7 +271,7 @@
 	if (forcejffs2 || forceyaffs) {
 		struct nand_oobinfo *oobsel = forcejffs2 ? &jffs2_oobinfo : &yaffs_oobinfo;
 		
-		if (forceyaffs && meminfo.oobsize == 8) {
+		if (meminfo.oobsize == 8) {
     			if (forceyaffs) {
 				fprintf (stderr, "YAFSS cannot operate on 256 Byte page size");
 				goto restoreoob;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-07 20:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-07 20:29 little mistake in nandwrite.c Michael

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.