mtd/util compr_rtime.c,NONE,1.1 Makefile,1.35,1.36 doc_loadbios.c,1.7,1.8 einfo.c,1.4,1.5 erase.c,1.10,1.11 eraseall.c,1.12,1.13 fcp.c,1.2,1.3 ftl_check.c,1.2,1.3 ftl_format.c,1.6,1.7 jffs2dump.c,1.2,1.3 lock.c,1.2,1.3 mkfs.ffs2.c,1.3,1.4 mkfs.jffs2.c,1.40,1.41 mtd_debug.c,1.4,1.5 nanddump.c,1.12,1.13 nandwrite.c,1.8,1.9 nftl_format.c,1.19,1.20 nftldump.c,1.14,1.15 unlock.c,1.2,1.3

David Woodhouse dwmw2 at infradead.org
Wed May 5 07:57:58 EDT 2004


Update of /home/cvs/mtd/util
In directory phoenix.infradead.org:/tmp/cvs-serv1889/util

Modified Files:
	Makefile doc_loadbios.c einfo.c erase.c eraseall.c fcp.c 
	ftl_check.c ftl_format.c jffs2dump.c lock.c mkfs.ffs2.c 
	mkfs.jffs2.c mtd_debug.c nanddump.c nandwrite.c nftl_format.c 
	nftldump.c unlock.c 
Added Files:
	compr_rtime.c 
Log Message:
Clean up includes of kernel headers -- pass 1

***** Error reading new file: [Errno 2] No such file or directory: 'compr_rtime.c'
Index: Makefile
===================================================================
RCS file: /home/cvs/mtd/util/Makefile,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- Makefile	24 Feb 2004 17:41:25 -0000	1.35
+++ Makefile	5 May 2004 11:57:54 -0000	1.36
@@ -12,17 +12,12 @@
 	einfo mtd_debug fcp nandwrite jffs2dump \
 	#jffs2reader nftldump nftl_format
 
-SYMLINKS = compr_rtime.c
-
 all: $(TARGETS)
 
 clean:
-	rm -f *.o $(TARGETS) $(SYMLINKS)
+	rm -f *.o $(TARGETS)
 
 mkfs.jffs2.o eraseall.o crc32.o: crc32.h
-
-$(SYMLINKS):
-	ln -sf ../fs/jffs2/$@ $@
 
 mkfs.jffs2: crc32.o compr_rtime.o mkfs.jffs2.o compr_zlib.o
 	$(CC) $(LDFLAGS) -o $@ $^ -lz

Index: doc_loadbios.c
===================================================================
RCS file: /home/cvs/mtd/util/doc_loadbios.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- doc_loadbios.c	22 Feb 2002 22:13:19 -0000	1.7
+++ doc_loadbios.c	5 May 2004 11:57:55 -0000	1.8
@@ -9,7 +9,7 @@
 #include <sys/mount.h>
 
 /* $Id$ */
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 
 unsigned char databuf[512];
 

Index: einfo.c
===================================================================
RCS file: /home/cvs/mtd/util/einfo.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- einfo.c	8 Oct 2001 09:14:18 -0000	1.4
+++ einfo.c	5 May 2004 11:57:55 -0000	1.5
@@ -6,7 +6,7 @@
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 
 int main(int argc,char *argv[])
 {

Index: erase.c
===================================================================
RCS file: /home/cvs/mtd/util/erase.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- erase.c	4 Mar 2003 09:12:03 -0000	1.10
+++ erase.c	5 May 2004 11:57:55 -0000	1.11
@@ -6,7 +6,7 @@
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 int region_erase(int Fd, int start, int count, int unlock, int regcount)
 {
 	int i, j;

Index: eraseall.c
===================================================================
RCS file: /home/cvs/mtd/util/eraseall.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- eraseall.c	2 May 2003 19:27:32 -0000	1.12
+++ eraseall.c	5 May 2004 11:57:55 -0000	1.13
@@ -37,8 +37,8 @@
 #include <sys/mount.h>
 #include "crc32.h"
 
-#include <linux/mtd/mtd.h>
-#include "linux/jffs2.h"
+#include <mtd/mtd-user.h>
+#include <mtd/jffs2-user.h>
 
 #define PROGRAM "eraseall"
 #define VERSION "0.1.2"
@@ -46,12 +46,13 @@
 static const char *exe_name;
 static const char *mtd_device;
 static int quiet;		/* true -- don't output progress */
-static int jffs2;		// fornmat for jffs2 usage
+static int jffs2;		// format for jffs2 usage
 
 static void process_options (int argc, char *argv[]);
 static void display_help (void);
 static void display_version (void);
 static struct jffs2_unknown_node cleanmarker;
+static int target_endian = __BYTE_ORDER;
 
 int main (int argc, char *argv[])
 {

Index: fcp.c
===================================================================
RCS file: /home/cvs/mtd/util/fcp.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- fcp.c	3 Apr 2003 11:43:37 -0000	1.2
+++ fcp.c	5 May 2004 11:57:55 -0000	1.3
@@ -39,7 +39,7 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 #include <getopt.h>
 
 typedef int bool;

Index: ftl_check.c
===================================================================
RCS file: /home/cvs/mtd/util/ftl_check.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ftl_check.c	3 May 2000 18:50:01 -0000	1.2
+++ ftl_check.c	5 May 2004 11:57:55 -0000	1.3
@@ -47,7 +47,7 @@
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 #include <linux/mtd/ftl.h>
 
 

Index: ftl_format.c
===================================================================
RCS file: /home/cvs/mtd/util/ftl_format.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ftl_format.c	18 May 2000 16:04:56 -0000	1.6
+++ ftl_format.c	5 May 2004 11:57:55 -0000	1.7
@@ -43,11 +43,11 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <sys/time.h>
+#include <time.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 #include <linux/mtd/ftl.h>
 
 /*====================================================================*/

Index: jffs2dump.c
===================================================================
RCS file: /home/cvs/mtd/util/jffs2dump.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- jffs2dump.c	30 Apr 2003 15:13:00 -0000	1.2
+++ jffs2dump.c	5 May 2004 11:57:55 -0000	1.3
@@ -29,8 +29,9 @@
 #include <sys/param.h>
 #include <asm/types.h>
 #include <dirent.h>
-#include <linux/jffs2.h>
-#include <asm/byteorder.h>
+#include <mtd/jffs2-user.h>
+#include <endian.h>
+#include <byteswap.h>
 #include <getopt.h>
 #include "crc32.h"
 
@@ -39,11 +40,12 @@
 
 #define PAD(x) (((x)+3)&~3)
 
-#define de32_to_cpu(x) (bigendian ? __be32_to_cpu(x.v32) : __le32_to_cpu(x.v32))
-#define de16_to_cpu(x) (bigendian ? __be16_to_cpu(x.v16) : __le16_to_cpu(x.v16))
-#define cnv_e32(x) ((jint32_t){(bigendian ? __be32_to_cpu(x.v32) : __le32_to_cpu(x.v32))})
-#define cnv_e16(x) ((jint16_t){(bigendian ? __be16_to_cpu(x.v16) : __le16_to_cpu(x.v16))})
-#define cpu_to_e32(x) ((jint32_t){(bigendian ? __cpu_to_le32(x) : __cpu_to_be32(x))})
+/* For outputting a byte-swapped version of the input image. */
+#define cnv_e32(x) ((jint32_t){bswap_32(x.v32)})
+#define cnv_e16(x) ((jint16_t){bswap_16(x.v16)})
+
+#define t32_backwards(x) ({ uint32_t __b = (x); (target_endian==__BYTE_ORDER)?bswap_32(__b):__b; })
+#define cpu_to_e32(x) ((jint32_t){t32_backwards(x)})
 
 // Global variables
 long	imglen;		// length of image
@@ -56,7 +58,8 @@
 	       "\n"
 	       "           --help     	              display this help and exit\n"
 	       "           --version  	              output version information and exit\n"
-	       "-b         --bigendian	              image is bigendian\n"
+	       "-b         --bigendian	              image is big endian\n"
+	       "-l         --littleendian             image is little endian\n"
 	       "-c         --content  	              dump image contents\n"
 	       "-e fname   --endianconvert=fname      convert image endianness, output to file fname\n"
 	       "-r         --recalccrc                recalc name and data crc on endian conversion\n" 	
@@ -84,7 +87,7 @@
 int 	verbose;		// verbose output
 char 	*img;			// filename of image
 int	dumpcontent;		// dump image content
-int	bigendian;		// image is big endian
+int	target_endian;		// image is big endian
 int	convertendian;		// convert endianness
 int	recalccrc;		// recalc name and data crc's on endian conversion
 char	cnvfile[256];		// filename for conversion output
@@ -100,6 +103,7 @@
 			{"help", no_argument, 0, 0},
 			{"version", no_argument, 0, 0},
 			{"bigendian", no_argument, 0, 'b'},
+			{"littleendian", no_argument, 0, 'l'},
 			{"content", no_argument, 0, 'c'},
 			{"endianconvert", required_argument, 0, 'e'},
 			{"recalccrc", required_argument, 0, 'r'},
@@ -128,7 +132,10 @@
 			verbose = 1;
 			break;
 		case 'b':
-			bigendian = 1;
+			target_endian = __BIG_ENDIAN;
+			break;
+		case 'l':
+			target_endian = __LITTLE_ENDIAN;
 			break;
 		case 'c':
 			dumpcontent = 1;
@@ -168,91 +175,91 @@
 		node = (union jffs2_node_union*) p;
 		
 		/* Skip empty space */
-		if (de16_to_cpu (node->u.magic) == 0xFFFF && de16_to_cpu (node->u.nodetype) == 0xFFFF) {
+		if (je16_to_cpu (node->u.magic) == 0xFFFF && je16_to_cpu (node->u.nodetype) == 0xFFFF) {
 			p += 4;
 			empty += 4;
 			continue;
 		}
 		
-		if (de16_to_cpu (node->u.magic) != JFFS2_MAGIC_BITMASK)	{
-			printf ("Wrong bitmask  at  0x%08x, 0x%04x\n", p - data, de16_to_cpu (node->u.magic));
+		if (je16_to_cpu (node->u.magic) != JFFS2_MAGIC_BITMASK)	{
+			printf ("Wrong bitmask  at  0x%08x, 0x%04x\n", p - data, je16_to_cpu (node->u.magic));
 			p += 4;
 			dirty += 4;
 			continue;
 		}
 
 		crc = crc32 (0, node, sizeof (struct jffs2_unknown_node) - 4);
-		if (crc != de32_to_cpu (node->u.hdr_crc)) {
-			printf ("Wrong hdr_crc  at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, de32_to_cpu (node->u.hdr_crc), crc);
+		if (crc != je32_to_cpu (node->u.hdr_crc)) {
+			printf ("Wrong hdr_crc  at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, je32_to_cpu (node->u.hdr_crc), crc);
 			p += 4;
 			dirty += 4;
 			continue;
 		}
 
-		switch(de16_to_cpu(node->u.nodetype)) {
+		switch(je16_to_cpu(node->u.nodetype)) {
 		
 		case JFFS2_NODETYPE_INODE:
 			printf ("Inode      node at 0x%08x, totlen 0x%08x, #ino  %5d, version %5d, isize %8d, csize %8d, dsize %8d, offset %8d\n",
-					p - data, de32_to_cpu (node->i.totlen), de32_to_cpu (node->i.ino),
-					de32_to_cpu ( node->i.version), de32_to_cpu (node->i.isize), 
-					de32_to_cpu (node->i.csize), de32_to_cpu (node->i.dsize), de32_to_cpu (node->i.offset));
+					p - data, je32_to_cpu (node->i.totlen), je32_to_cpu (node->i.ino),
+					je32_to_cpu ( node->i.version), je32_to_cpu (node->i.isize), 
+					je32_to_cpu (node->i.csize), je32_to_cpu (node->i.dsize), je32_to_cpu (node->i.offset));
 
 			crc = crc32 (0, node, sizeof (struct jffs2_raw_inode) - 8);
-			if (crc != de32_to_cpu (node->i.node_crc)) {
-				printf ("Wrong node_crc at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, de32_to_cpu (node->i.node_crc), crc);
-				p += PAD(de32_to_cpu (node->i.totlen));
-				dirty += PAD(de32_to_cpu (node->i.totlen));;
+			if (crc != je32_to_cpu (node->i.node_crc)) {
+				printf ("Wrong node_crc at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, je32_to_cpu (node->i.node_crc), crc);
+				p += PAD(je32_to_cpu (node->i.totlen));
+				dirty += PAD(je32_to_cpu (node->i.totlen));;
 				continue;
 			}
 			
-			crc = crc32(0, p + sizeof (struct jffs2_raw_inode), de32_to_cpu(node->i.csize));
-			if (crc != de32_to_cpu(node->i.data_crc)) {
-				printf ("Wrong data_crc at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, de32_to_cpu (node->i.data_crc), crc);
-				p += PAD(de32_to_cpu (node->i.totlen));
-				dirty += PAD(de32_to_cpu (node->i.totlen));;
+			crc = crc32(0, p + sizeof (struct jffs2_raw_inode), je32_to_cpu(node->i.csize));
+			if (crc != je32_to_cpu(node->i.data_crc)) {
+				printf ("Wrong data_crc at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, je32_to_cpu (node->i.data_crc), crc);
+				p += PAD(je32_to_cpu (node->i.totlen));
+				dirty += PAD(je32_to_cpu (node->i.totlen));;
 				continue;
 			}
 
-			p += PAD(de32_to_cpu (node->i.totlen));
+			p += PAD(je32_to_cpu (node->i.totlen));
 			break;
 				
 		case JFFS2_NODETYPE_DIRENT:
 			memcpy (name, node->d.name, node->d.nsize);
 			name [node->d.nsize] = 0x0;
 			printf ("Dirent     node at 0x%08x, totlen 0x%08x, #pino %5d, version %5d, #ino  %8d, nsize %8d, name %s\n",
-					p - data, de32_to_cpu (node->d.totlen), de32_to_cpu (node->d.pino),
-					de32_to_cpu ( node->d.version), de32_to_cpu (node->d.ino), 
+					p - data, je32_to_cpu (node->d.totlen), je32_to_cpu (node->d.pino),
+					je32_to_cpu ( node->d.version), je32_to_cpu (node->d.ino), 
 					node->d.nsize, name);
 
 			crc = crc32 (0, node, sizeof (struct jffs2_raw_dirent) - 8);
-			if (crc != de32_to_cpu (node->d.node_crc)) {
-				printf ("Wrong node_crc at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, de32_to_cpu (node->d.node_crc), crc);
-				p += PAD(de32_to_cpu (node->d.totlen));
-				dirty += PAD(de32_to_cpu (node->d.totlen));;
+			if (crc != je32_to_cpu (node->d.node_crc)) {
+				printf ("Wrong node_crc at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, je32_to_cpu (node->d.node_crc), crc);
+				p += PAD(je32_to_cpu (node->d.totlen));
+				dirty += PAD(je32_to_cpu (node->d.totlen));;
 				continue;
 			}
 			
 			crc = crc32(0, p + sizeof (struct jffs2_raw_dirent), node->d.nsize);
-			if (crc != de32_to_cpu(node->d.name_crc)) {
-				printf ("Wrong name_crc at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, de32_to_cpu (node->d.name_crc), crc);
-				p += PAD(de32_to_cpu (node->d.totlen));
-				dirty += PAD(de32_to_cpu (node->d.totlen));;
+			if (crc != je32_to_cpu(node->d.name_crc)) {
+				printf ("Wrong name_crc at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, je32_to_cpu (node->d.name_crc), crc);
+				p += PAD(je32_to_cpu (node->d.totlen));
+				dirty += PAD(je32_to_cpu (node->d.totlen));;
 				continue;
 			}
 
-			p += PAD(de32_to_cpu (node->d.totlen));						
+			p += PAD(je32_to_cpu (node->d.totlen));						
 			break;
 	
 		case JFFS2_NODETYPE_CLEANMARKER:
 			if (verbose)
-				printf ("Cleanmarker     at 0x%08x, totlen 0x%08x\n", p - data, de32_to_cpu (node->u.totlen));
-			p += PAD(de32_to_cpu (node->u.totlen));						
+				printf ("Cleanmarker     at 0x%08x, totlen 0x%08x\n", p - data, je32_to_cpu (node->u.totlen));
+			p += PAD(je32_to_cpu (node->u.totlen));						
 			break;
 	
 		case JFFS2_NODETYPE_PADDING:
 			if (verbose)
-				printf ("Padding    node at 0x%08x, totlen 0x%08x\n", p - data, de32_to_cpu (node->u.totlen));
-			p += PAD(de32_to_cpu (node->u.totlen));						
+				printf ("Padding    node at 0x%08x, totlen 0x%08x\n", p - data, je32_to_cpu (node->u.totlen));
+			p += PAD(je32_to_cpu (node->u.totlen));						
 			break;
 			
 		case 0xffff:
@@ -262,9 +269,9 @@
 			
 		default:	
 			if (verbose)
-				printf ("Unknown    node at 0x%08x, totlen 0x%08x\n", p - data, de32_to_cpu (node->u.totlen));
-			p += PAD(de32_to_cpu (node->u.totlen));						
-			dirty += PAD(de32_to_cpu (node->u.totlen));						
+				printf ("Unknown    node at 0x%08x, totlen 0x%08x\n", p - data, je32_to_cpu (node->u.totlen));
+			p += PAD(je32_to_cpu (node->u.totlen));						
+			dirty += PAD(je32_to_cpu (node->u.totlen));						
 	
 		}
 	}
@@ -294,14 +301,14 @@
 		node = (union jffs2_node_union*) p;
 
 		/* Skip empty space */
-		if (de16_to_cpu (node->u.magic) == 0xFFFF && de16_to_cpu (node->u.nodetype) == 0xFFFF) {
+		if (je16_to_cpu (node->u.magic) == 0xFFFF && je16_to_cpu (node->u.nodetype) == 0xFFFF) {
 			write (fd, p, 4);
 			p += 4;
 			continue;
 		}
 		
-		if (de16_to_cpu (node->u.magic) != JFFS2_MAGIC_BITMASK)	{
-			printf ("Wrong bitmask  at  0x%08x, 0x%04x\n", p - data, de16_to_cpu (node->u.magic));
+		if (je16_to_cpu (node->u.magic) != JFFS2_MAGIC_BITMASK)	{
+			printf ("Wrong bitmask  at  0x%08x, 0x%04x\n", p - data, je16_to_cpu (node->u.magic));
 			newnode.u.magic = cnv_e16 (node->u.magic);			
 			newnode.u.nodetype = cnv_e16 (node->u.nodetype);
 			write (fd, &newnode, 4);
@@ -310,11 +317,11 @@
 		}
 
 		crc = crc32 (0, node, sizeof (struct jffs2_unknown_node) - 4);
-		if (crc != de32_to_cpu (node->u.hdr_crc)) {
-			printf ("Wrong hdr_crc  at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, de32_to_cpu (node->u.hdr_crc), crc);
+		if (crc != je32_to_cpu (node->u.hdr_crc)) {
+			printf ("Wrong hdr_crc  at  0x%08x, 0x%08x instead of 0x%08x\n", p - data, je32_to_cpu (node->u.hdr_crc), crc);
 		}
 
-		switch(de16_to_cpu(node->u.nodetype)) {
+		switch(je16_to_cpu(node->u.nodetype)) {
 
 		case JFFS2_NODETYPE_INODE:
 
@@ -340,7 +347,7 @@
 			newnode.i.usercompr = node->i.usercompr;
 			newnode.i.flags = cnv_e16 (node->i.flags);
 			if (recalccrc) {
-				len = de32_to_cpu(node->i.csize);
+				len = je32_to_cpu(node->i.csize);
 				newnode.i.data_crc = cpu_to_e32 ( crc32(0, p + sizeof (struct jffs2_raw_inode), len));
 			} else
 				newnode.i.data_crc = cnv_e32 (node->i.data_crc);
@@ -348,9 +355,9 @@
 			newnode.i.node_crc = cpu_to_e32 (crc32 (0, &newnode, sizeof (struct jffs2_raw_inode) - 8));
 			
 			write (fd, &newnode, sizeof (struct jffs2_raw_inode));
-			write (fd, p + sizeof (struct jffs2_raw_inode), PAD (de32_to_cpu (node->i.totlen) -  sizeof (struct jffs2_raw_inode)));
+			write (fd, p + sizeof (struct jffs2_raw_inode), PAD (je32_to_cpu (node->i.totlen) -  sizeof (struct jffs2_raw_inode)));
 
-			p += PAD(de32_to_cpu (node->i.totlen));						
+			p += PAD(je32_to_cpu (node->i.totlen));						
 			break;
 				
 		case JFFS2_NODETYPE_DIRENT:
@@ -373,8 +380,8 @@
 				newnode.d.name_crc = cnv_e32 (node->d.name_crc);
 
 			write (fd, &newnode, sizeof (struct jffs2_raw_dirent));
-			write (fd, p + sizeof (struct jffs2_raw_dirent), PAD (de32_to_cpu (node->d.totlen) -  sizeof (struct jffs2_raw_dirent)));
-			p += PAD(de32_to_cpu (node->d.totlen));						
+			write (fd, p + sizeof (struct jffs2_raw_dirent), PAD (je32_to_cpu (node->d.totlen) -  sizeof (struct jffs2_raw_dirent)));
+			p += PAD(je32_to_cpu (node->d.totlen));						
 			break;
 	
 		case JFFS2_NODETYPE_CLEANMARKER:
@@ -385,11 +392,11 @@
 			newnode.u.hdr_crc = cpu_to_e32 (crc32 (0, &newnode, sizeof (struct jffs2_unknown_node) - 4));
 			
 			write (fd, &newnode, sizeof (struct jffs2_unknown_node));
-			len = PAD(de32_to_cpu (node->u.totlen) - sizeof (struct jffs2_unknown_node));
+			len = PAD(je32_to_cpu (node->u.totlen) - sizeof (struct jffs2_unknown_node));
 			if (len > 0) 
 				write (fd, p + sizeof (struct jffs2_unknown_node), len);
 				
-			p += PAD(de32_to_cpu (node->u.totlen));						
+			p += PAD(je32_to_cpu (node->u.totlen));						
 			break;
 	
 		case 0xffff:
@@ -398,8 +405,8 @@
 			break;
 			
 		default:	
-			printf ("Unknown node type: 0x%04x at 0x%08x, totlen 0x%08x\n", de16_to_cpu (node->u.nodetype), p - data, de32_to_cpu (node->u.totlen));
-			p += PAD(de32_to_cpu (node->u.totlen));
+			printf ("Unknown node type: 0x%04x at 0x%08x, totlen 0x%08x\n", je16_to_cpu (node->u.nodetype), p - data, je32_to_cpu (node->u.totlen));
+			p += PAD(je32_to_cpu (node->u.totlen));
 				
 		}
 	}

Index: lock.c
===================================================================
RCS file: /home/cvs/mtd/util/lock.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- lock.c	14 Mar 2001 02:31:02 -0000	1.2
+++ lock.c	5 May 2004 11:57:55 -0000	1.3
@@ -14,7 +14,7 @@
 #include <sys/mount.h>
 #include <string.h>
 
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 
 int main(int argc, char *argv[])
 {

Index: mkfs.ffs2.c
===================================================================
RCS file: /home/cvs/mtd/util/mkfs.ffs2.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mkfs.ffs2.c	11 Mar 2001 11:44:42 -0000	1.3
+++ mkfs.ffs2.c	5 May 2004 11:57:55 -0000	1.4
@@ -20,7 +20,7 @@
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 
-#include <linux/mtd/mtd.h"
+#include <mtd/mtd-user.h"
 #include <linux/ffs2_fs.h"
 
 static unsigned long BlockSize = 128*1024;

Index: mkfs.jffs2.c
===================================================================
RCS file: /home/cvs/mtd/util/mkfs.jffs2.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- mkfs.jffs2.c	15 Feb 2004 17:21:58 -0000	1.40
+++ mkfs.jffs2.c	5 May 2004 11:57:55 -0000	1.41
@@ -643,25 +643,7 @@
 }
 
 /* Here is where we do the actual creation of the file system */
-#include "linux/jffs2.h"
-
-#undef cpu_to_je16
-#undef cpu_to_je32
-#undef cpu_to_jemode
-#undef je16_to_cpu
-#undef je32_to_cpu
-#undef jemode_to_cpu
-
-#define t16(x) ({ uint16_t b = x; (target_endian==__BYTE_ORDER)?x:bswap_16(b); })
-#define t32(x) ({ uint32_t b = x; (target_endian==__BYTE_ORDER)?x:bswap_32(b); })
-
-#define cpu_to_je16(x) ((jint16_t){t16(x)})
-#define cpu_to_je32(x) ((jint32_t){t32(x)})
-#define cpu_to_jemode(x) ((jmode_t){t32(x)})
-
-#define je16_to_cpu(x) (t16((x).v16))
-#define je32_to_cpu(x) (t32((x).v32))
-#define jemode_to_cpu(x) (t32((x).m))
+#include "mtd/jffs2-user.h"
 
 #define JFFS2_MAX_FILE_SIZE 0xFFFFFFFF
 #ifndef JFFS2_MAX_SYMLINK_LEN

Index: mtd_debug.c
===================================================================
RCS file: /home/cvs/mtd/util/mtd_debug.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- mtd_debug.c	3 Apr 2003 11:50:43 -0000	1.4
+++ mtd_debug.c	5 May 2004 11:57:55 -0000	1.5
@@ -39,7 +39,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 
 /*
  * MEMGETINFO

Index: nanddump.c
===================================================================
RCS file: /home/cvs/mtd/util/nanddump.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- nanddump.c	20 Feb 2003 13:34:20 -0000	1.12
+++ nanddump.c	5 May 2004 11:57:55 -0000	1.13
@@ -27,7 +27,7 @@
 #include <sys/stat.h>
 
 #include <asm/types.h>
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 
 /*
  * Buffers for reading data from flash

Index: nandwrite.c
===================================================================
RCS file: /home/cvs/mtd/util/nandwrite.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- nandwrite.c	30 Apr 2003 13:55:40 -0000	1.8
+++ nandwrite.c	5 May 2004 11:57:55 -0000	1.9
@@ -34,7 +34,7 @@
 #include <getopt.h>
 
 #include <asm/types.h>
-#include "linux/mtd/mtd.h"
+#include "mtd/mtd-user.h"
 
 #define PROGRAM "nandwrite"
 #define VERSION "1.2"

Index: nftl_format.c
===================================================================
RCS file: /home/cvs/mtd/util/nftl_format.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- nftl_format.c	1 May 2002 10:59:04 -0000	1.19
+++ nftl_format.c	5 May 2004 11:57:55 -0000	1.20
@@ -35,7 +35,7 @@
 #include <string.h>
 
 #include <asm/types.h>
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 #include <linux/mtd/nftl.h>
 
 #define swab16(x) \

Index: nftldump.c
===================================================================
RCS file: /home/cvs/mtd/util/nftldump.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- nftldump.c	16 Jul 2001 16:13:50 -0000	1.14
+++ nftldump.c	5 May 2004 11:57:55 -0000	1.15
@@ -34,7 +34,7 @@
 
 #include <sys/ioctl.h>
 #include <asm/types.h>
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 #include <linux/mtd/nftl.h>
 
 extern ssize_t pread();

Index: unlock.c
===================================================================
RCS file: /home/cvs/mtd/util/unlock.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- unlock.c	14 Mar 2001 02:31:17 -0000	1.2
+++ unlock.c	5 May 2004 11:57:55 -0000	1.3
@@ -14,7 +14,7 @@
 #include <sys/mount.h>
 #include <string.h>
 
-#include <linux/mtd/mtd.h>
+#include <mtd/mtd-user.h>
 
 int main(int argc, char *argv[])
 {




More information about the linux-mtd-cvs mailing list