diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/ChangeLog /cygdrive/c/development/ecos/packages/fs/jffs2/current/ChangeLog
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/ChangeLog	2006-05-10 00:17:55.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/ChangeLog	2007-01-24 10:27:13.775336300 +0800
@@ -1,5 +1,19 @@
+2007-01-24  Wang Cui  <iucgnaw@msn.com>
+
+	* cdl/jffs2.cdl: Fixed CYGNUM_JFFS2_GS_THREAD_TICKS to CYGNUM_JFFS2_GC_THREAD_TICKS.
+	                 Modified CYGPKG_FS_JFFS2_CFLAGS_ADD, add "-D_POSIX_SOURCE" if CYGPKG_POSIX is present.
+	* src/erase.c: Fixed warning.
+	* src/flashio.c: Fixed warning.
+	* src/gc.c: Fixed warning.
+	* src/gcthread.c: Fixed CYGNUM_JFFS2_GS_THREAD_TICKS to CYGNUM_JFFS2_GC_THREAD_TICKS.
+	* src/nodelist.c: Fixed warning.
+	* src/nodemgmt.c: Fixed warning.
+	* src/read.c: Fixed warning.
+	* src/readinode.c: Fixed warning.
+	* src/write.c: Fixed warning.
+
 2006-03-09  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/fs-ecos.c: Generalise the check for broken ARM compilers
 	and add the MIPS compiler as also being broken.
 
diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/cdl/jffs2.cdl /cygdrive/c/development/ecos/packages/fs/jffs2/current/cdl/jffs2.cdl
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/cdl/jffs2.cdl	2005-07-30 23:30:41.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/cdl/jffs2.cdl	2007-01-11 13:37:23.782212600 +0800
@@ -107,11 +107,11 @@
             description    "
                 This option sets the size of the stack used
                 for jffs2 garbage collect thread"
         }
         
-        cdl_option CYGNUM_JFFS2_GS_THREAD_TICKS {
+        cdl_option CYGNUM_JFFS2_GC_THREAD_TICKS {
             display       "ticks between each garbage collect"
             flavor        data
             default_value 100
             description   "
                 This option sets how many clock ticks there will be between
@@ -232,11 +232,11 @@
 	flavor  data
 	no_define
 	# We add '-D__ECOS' to trigger eCos-specific code in places.
 	# We add '-nostdinc -iwithprefix include' to avoid picking up
 	#    native <linux/*.h> include files when building on Linux.
-	default_value { "-D__ECOS -nostdinc -iwithprefix include" }
+	default_value { (CYGPKG_POSIX ? "-D_POSIX_SOURCE " : "") . "-D__ECOS -nostdinc -iwithprefix include" }
 	description   "
 	    This option modifies the set of compiler flags for
             building the JFFS2 package.
             These flags are used in addition
             to the set of global flags."
diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/erase.c /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/erase.c
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/erase.c	2005-07-30 23:30:42.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/erase.c	2007-01-10 13:39:07.030169600 +0800
@@ -331,11 +331,11 @@
 			printk(KERN_WARNING "Short read from newly-erased block at 0x%08x. Wanted %d, got %zd\n", ofs, readlen, retlen);
 			goto fail;
 		}
 		for (i=0; i<readlen; i += sizeof(unsigned long)) {
 			/* It's OK. We know it's properly aligned */
-			unsigned long *datum = ebuf + i;
+			unsigned long *datum = (unsigned long *)((unsigned char *)ebuf + i);
 			if (*datum + 1) {
 				*bad_offset += i;
 				printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n", *datum, *bad_offset);
 				goto fail;
 			}
diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/flashio.c /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/flashio.c
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/flashio.c	2005-07-30 23:30:42.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/flashio.c	2006-12-31 14:44:24.081204400 +0800
@@ -99,11 +99,11 @@
 					       vecs[j].iov_len);
 					cbufptr += vecs[j].iov_len;
 				}
 				ret =
 				    jffs2_flash_write(c, to, sizetomalloc,
-						      &thislen, cbuf);
+						      &thislen, (unsigned char *)(cbuf));
 				if (thislen > totvecsize)	// in case it was aligned up
 					thislen = totvecsize;
 				totlen += thislen;
 				free(cbuf);
 				goto writev_out;
@@ -118,11 +118,11 @@
 				lentowrite &= ~(sizeof (int) - 1);
 				memcpy(buf, vecs[i].iov_base, lentowrite);
 
 				ret =
 				    jffs2_flash_write(c, to, lentowrite,
-						      &thislen, (char *) &buf);
+						      &thislen, (unsigned char *)(&buf));
 				if (thislen > vecs[i].iov_len)
 					thislen = vecs[i].iov_len;
 			}	// else
 		} else
 			ret =
diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/gc.c /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/gc.c
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/gc.c	2005-07-30 23:30:42.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/gc.c	2006-12-31 11:53:05.979009400 +0800
@@ -525,11 +525,11 @@
 
 	node = kmalloc(rawlen, GFP_KERNEL);
 	if (!node)
                return -ENOMEM;
 
-	ret = jffs2_flash_read(c, ref_offset(raw), rawlen, &retlen, (char *)node);
+	ret = jffs2_flash_read(c, ref_offset(raw), rawlen, &retlen, (unsigned char *)node);
 	if (!ret && retlen != rawlen)
 		ret = -EIO;
 	if (ret)
 		goto out_node;
 
@@ -592,11 +592,11 @@
  retry:
 	nraw->flash_offset = phys_ofs;
 	nraw->__totlen = rawlen;
 	nraw->next_phys = NULL;
 
-	ret = jffs2_flash_write(c, phys_ofs, rawlen, &retlen, (char *)node);
+	ret = jffs2_flash_write(c, phys_ofs, rawlen, &retlen, (unsigned char *)node);
 
 	if (ret || (retlen != rawlen)) {
 		printk(KERN_NOTICE "Write of %d bytes at 0x%08x failed. returned %d, retlen %zd\n",
                        rawlen, phys_ofs, ret, retlen);
 		if (retlen) {
@@ -689,11 +689,11 @@
 		mdata = kmalloc(fn->size, GFP_KERNEL);
 		if (!mdata) {
 			printk(KERN_WARNING "kmalloc of mdata failed in jffs2_garbage_collect_metadata()\n");
 			return -ENOMEM;
 		}
-		ret = jffs2_read_dnode(c, f, fn, mdata, 0, mdatalen);
+		ret = jffs2_read_dnode(c, f, fn, (unsigned char *)(mdata), 0, mdatalen);
 		if (ret) {
 			printk(KERN_WARNING "read of old metadata failed in jffs2_garbage_collect_metadata(): %d\n", ret);
 			kfree(mdata);
 			return ret;
 		}
@@ -736,11 +736,11 @@
 	ri.dsize = cpu_to_je32(mdatalen);
 	ri.compr = JFFS2_COMPR_NONE;
 	ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8));
 	ri.data_crc = cpu_to_je32(crc32(0, mdata, mdatalen));
 
-	new_fn = jffs2_write_dnode(c, f, &ri, mdata, mdatalen, phys_ofs, ALLOC_GC);
+	new_fn = jffs2_write_dnode(c, f, &ri, (unsigned char *)(mdata), mdatalen, phys_ofs, ALLOC_GC);
 
 	if (IS_ERR(new_fn)) {
 		printk(KERN_WARNING "Error writing new dnode: %ld\n", PTR_ERR(new_fn));
 		ret = PTR_ERR(new_fn);
 		goto out;
@@ -762,11 +762,11 @@
 	uint32_t alloclen, phys_ofs;
 	int ret;
 
 	rd.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
 	rd.nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT);
-	rd.nsize = strlen(fd->name);
+	rd.nsize = strlen((char *)(fd->name));
 	rd.totlen = cpu_to_je32(sizeof(rd) + rd.nsize);
 	rd.hdr_crc = cpu_to_je32(crc32(0, &rd, sizeof(struct jffs2_unknown_node)-4));
 
 	rd.pino = cpu_to_je32(f->inocache->ino);
 	rd.version = cpu_to_je32(++f->highest_version);
@@ -806,11 +806,11 @@
 	if (!jffs2_can_mark_obsolete(c)) {
 		struct jffs2_raw_dirent *rd;
 		struct jffs2_raw_node_ref *raw;
 		int ret;
 		size_t retlen;
-		int name_len = strlen(fd->name);
+		int name_len = strlen((char *)(fd->name));
 		uint32_t name_crc = crc32(0, fd->name, name_len);
 		uint32_t rawlen = ref_totlen(c, jeb, fd->raw);
 
 		rd = kmalloc(rawlen, GFP_KERNEL);
 		if (!rd)
@@ -838,11 +838,11 @@
 
 			D1(printk(KERN_DEBUG "Check potential deletion dirent at %08x\n", ref_offset(raw)));
 
 			/* This is an obsolete node belonging to the same directory, and it's of the right
 			   length. We need to take a closer look...*/
-			ret = jffs2_flash_read(c, ref_offset(raw), rawlen, &retlen, (char *)rd);
+			ret = jffs2_flash_read(c, ref_offset(raw), rawlen, &retlen, (unsigned char *)rd);
 			if (ret) {
 				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Read error (%d) reading obsolete node at %08x\n", ret, ref_offset(raw));
 				/* If we can't read it, we don't need to continue to obsolete it. Continue */
 				continue;
 			}
@@ -918,11 +918,11 @@
 	if(fn->frags > 1) {
 		size_t readlen;
 		uint32_t crc;
 		/* It's partially obsoleted by a later write. So we have to 
 		   write it out again with the _same_ version as before */
-		ret = jffs2_flash_read(c, ref_offset(fn->raw), sizeof(ri), &readlen, (char *)&ri);
+		ret = jffs2_flash_read(c, ref_offset(fn->raw), sizeof(ri), &readlen, (unsigned char *)&ri);
 		if (readlen != sizeof(ri) || ret) {
 			printk(KERN_WARNING "Node read failed in jffs2_garbage_collect_hole. Ret %d, retlen %zd. Data will be lost by writing new hole node\n", ret, readlen);
 			goto fill;
 		}
 		if (je16_to_cpu(ri.nodetype) != JFFS2_NODETYPE_INODE) {
diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/gcthread.c /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/gcthread.c
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/gcthread.c	2005-07-30 23:30:42.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/gcthread.c	2007-01-11 13:37:32.047943400 +0800
@@ -97,11 +97,11 @@
      while(1) {
           flag=cyg_flag_timed_wait(&sb->s_gc_thread_flags,
                                    GC_THREAD_FLAG_TRIG|GC_THREAD_FLAG_STOP,
                                    CYG_FLAG_WAITMODE_OR| CYG_FLAG_WAITMODE_CLR,
                                    cyg_current_time()+
-                                   CYGNUM_JFFS2_GS_THREAD_TICKS);
+                                   CYGNUM_JFFS2_GC_THREAD_TICKS);
           
           if (flag & GC_THREAD_FLAG_STOP)
                break;
           
           D1(printk("jffs2: GC THREAD GC BEGIN\n"));
diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/nodelist.c /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/nodelist.c
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/nodelist.c	2005-07-30 23:30:42.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/nodelist.c	2006-12-31 11:30:50.145558400 +0800
@@ -26,11 +26,11 @@
 	struct jffs2_full_dirent **prev = list;
 	
 	JFFS2_DBG_DENTLIST("add dirent \"%s\", ino #%u\n", new->name, new->ino);
 
 	while ((*prev) && (*prev)->nhash <= new->nhash) {
-		if ((*prev)->nhash == new->nhash && !strcmp((*prev)->name, new->name)) {
+		if ((*prev)->nhash == new->nhash && !strcmp((char *)((*prev)->name), (char *)(new->name))) {
 			/* Duplicate. Free one */
 			if (new->version < (*prev)->version) {
 				JFFS2_DBG_DENTLIST("Eep! Marking new dirent node is obsolete, old is \"%s\", ino #%u\n",
 					(*prev)->name, (*prev)->ino);
 				jffs2_mark_node_obsolete(c, new->raw);
diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/nodemgmt.c /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/nodemgmt.c
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/nodemgmt.c	2005-07-30 23:30:42.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/nodemgmt.c	2006-12-31 11:33:57.710459200 +0800
@@ -539,11 +539,11 @@
 	   and potentially put its eraseblock onto the erase_pending_list. Thus, we know that
 	   the block hasn't _already_ been erased, and that 'ref' itself hasn't been freed yet
 	   by jffs2_free_all_node_refs() in erase.c. Which is nice. */
 
 	D1(printk(KERN_DEBUG "obliterating obsoleted node at 0x%08x\n", ref_offset(ref)));
-	ret = jffs2_flash_read(c, ref_offset(ref), sizeof(n), &retlen, (char *)&n);
+	ret = jffs2_flash_read(c, ref_offset(ref), sizeof(n), &retlen, (unsigned char *)&n);
 	if (ret) {
 		printk(KERN_WARNING "Read error reading from obsoleted node at 0x%08x: %d\n", ref_offset(ref), ret);
 		goto out_erase_sem;
 	}
 	if (retlen != sizeof(n)) {
@@ -558,11 +558,11 @@
 		D1(printk(KERN_DEBUG "Node at 0x%08x was already marked obsolete (nodetype 0x%04x)\n", ref_offset(ref), je16_to_cpu(n.nodetype)));
 		goto out_erase_sem;
 	}
 	/* XXX FIXME: This is ugly now */
 	n.nodetype = cpu_to_je16(je16_to_cpu(n.nodetype) & ~JFFS2_NODE_ACCURATE);
-	ret = jffs2_flash_write(c, ref_offset(ref), sizeof(n), &retlen, (char *)&n);
+	ret = jffs2_flash_write(c, ref_offset(ref), sizeof(n), &retlen, (unsigned char *)&n);
 	if (ret) {
 		printk(KERN_WARNING "Write error in obliterating obsoleted node at 0x%08x: %d\n", ref_offset(ref), ret);
 		goto out_erase_sem;
 	}
 	if (retlen != sizeof(n)) {
diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/read.c /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/read.c
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/read.c	2005-07-30 23:30:42.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/read.c	2006-12-31 11:42:24.732574000 +0800
@@ -33,11 +33,11 @@
 
 	ri = jffs2_alloc_raw_inode();
 	if (!ri)
 		return -ENOMEM;
 
-	ret = jffs2_flash_read(c, ref_offset(fd->raw), sizeof(*ri), &readlen, (char *)ri);
+	ret = jffs2_flash_read(c, ref_offset(fd->raw), sizeof(*ri), &readlen, (unsigned char *)ri);
 	if (ret) {
 		jffs2_free_raw_inode(ri);
 		printk(KERN_WARNING "Error reading node from 0x%08x: %d\n", ref_offset(fd->raw), ret);
 		return ret;
 	}
diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/readinode.c /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/readinode.c
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/readinode.c	2005-07-30 23:30:42.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/readinode.c	2006-12-31 11:41:16.528576000 +0800
@@ -186,11 +186,11 @@
 		/* FIXME: point() */
 		int err;
 		int already = read - sizeof(*rd);
 			
 		err = jffs2_flash_read(c, (ref_offset(ref)) + read, 
-				rd->nsize - already, &read, &fd->name[already]);
+				rd->nsize - already, (size_t *)(&read), &fd->name[already]);
 		if (unlikely(read != rd->nsize - already) && likely(!err))
 			return -EIO;
 			
 		if (unlikely(err)) {
 			JFFS2_ERROR("read remainder of name: error %d\n", err);
@@ -276,11 +276,11 @@
 				buf = kmalloc(je32_to_cpu(rd->csize), GFP_KERNEL);
 				if (!buf)
 					return -ENOMEM;
 				
 				err = jffs2_flash_read(c, ref_offset(ref) + sizeof(*rd), je32_to_cpu(rd->csize),
-							&read, buf);
+							(size_t *)(&read), buf);
 				if (unlikely(read != je32_to_cpu(rd->csize)) && likely(!err))
 					err = -EIO;
 				if (err) {
 					kfree(buf);
 					return err;
@@ -475,11 +475,11 @@
 				JFFS2_ERROR("short read dirent at %#08x\n", ref_offset(ref));
 				err = -EIO;
 				goto free_out;
 			}
 
-			err = read_direntry(c, ref, &node.d, retlen, &ret_fd, latest_mctime, mctime_ver);
+			err = read_direntry(c, ref, &node.d, retlen, &ret_fd, (int32_t *)(latest_mctime), mctime_ver);
 			if (err == 1) {
 				jffs2_mark_node_obsolete(c, ref);
 				break;
 			} else if (unlikely(err))
 				goto free_out;
@@ -496,11 +496,11 @@
 				JFFS2_ERROR("short read dnode at %#08x\n", ref_offset(ref));
 				err = -EIO;
 				goto free_out;
 			}
 
-			err = read_dnode(c, ref, &node.i, retlen, &ret_tn, latest_mctime, mctime_ver);
+			err = read_dnode(c, ref, &node.i, retlen, &ret_tn, (int32_t *)(latest_mctime), mctime_ver);
 			if (err == 1) {
 				jffs2_mark_node_obsolete(c, ref);
 				break;
 			} else if (unlikely(err))
 				goto free_out;
@@ -708,11 +708,11 @@
 				jffs2_do_clear_inode(c, f);
 				return -ENOMEM;
 			}
 			
 			ret = jffs2_flash_read(c, ref_offset(fn->raw) + sizeof(*latest_node),
-						je32_to_cpu(latest_node->csize), &retlen, (char *)f->target);
+						je32_to_cpu(latest_node->csize), &retlen, (unsigned char *)f->target);
 			
 			if (ret  || retlen != je32_to_cpu(latest_node->csize)) {
 				if (retlen != je32_to_cpu(latest_node->csize))
 					ret = -EIO;
 				kfree(f->target);
diff -r -u5 -N -x CVS /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/write.c /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/write.c
--- /cygdrive/w/Share/anon_cvs/ecos/packages/fs/jffs2/current/src/write.c	2005-07-30 23:30:42.000000000 +0800
+++ /cygdrive/c/development/ecos/packages/fs/jffs2/current/src/write.c	2006-12-31 11:56:34.546662800 +0800
@@ -247,11 +247,11 @@
 		return ERR_PTR(-ENOMEM);
 	}
 
 	fd->version = je32_to_cpu(rd->version);
 	fd->ino = je32_to_cpu(rd->ino);
-	fd->nhash = full_name_hash(name, strlen(name));
+	fd->nhash = full_name_hash(name, strlen((char *)(name)));
 	fd->type = rd->type;
 	memcpy(fd->name, name, namelen);
 	fd->name[namelen]=0;
 
  retry:
@@ -507,11 +507,11 @@
 	rd->nsize = namelen;
 	rd->type = DT_REG;
 	rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
 	rd->name_crc = cpu_to_je32(crc32(0, name, namelen));
 
-	fd = jffs2_write_dirent(c, dir_f, rd, name, namelen, phys_ofs, ALLOC_NORMAL);
+	fd = jffs2_write_dirent(c, dir_f, rd, (unsigned char *)(name), namelen, phys_ofs, ALLOC_NORMAL);
 
 	jffs2_free_raw_dirent(rd);
 	
 	if (IS_ERR(fd)) {
 		/* dirent failed to write. Delete the inode normally 
@@ -569,11 +569,11 @@
 		rd->nsize = namelen;
 		rd->type = DT_UNKNOWN;
 		rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
 		rd->name_crc = cpu_to_je32(crc32(0, name, namelen));
 
-		fd = jffs2_write_dirent(c, dir_f, rd, name, namelen, phys_ofs, ALLOC_DELETION);
+		fd = jffs2_write_dirent(c, dir_f, rd, (unsigned char *)(name), namelen, phys_ofs, ALLOC_DELETION);
 		
 		jffs2_free_raw_dirent(rd);
 
 		if (IS_ERR(fd)) {
 			jffs2_complete_reservation(c);
@@ -584,11 +584,11 @@
 		/* File it. This will mark the old one obsolete. */
 		jffs2_add_fd_to_list(c, fd, &dir_f->dents);
 		up(&dir_f->sem);
 	} else {
 		struct jffs2_full_dirent **prev = &dir_f->dents;
-		uint32_t nhash = full_name_hash(name, namelen);
+		uint32_t nhash = full_name_hash((unsigned char *)(name), namelen);
 
 		down(&dir_f->sem);
 
 		while ((*prev) && (*prev)->nhash <= nhash) {
 			if ((*prev)->nhash == nhash && 
@@ -680,11 +680,11 @@
 	rd->type = type;
 
 	rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
 	rd->name_crc = cpu_to_je32(crc32(0, name, namelen));
 
-	fd = jffs2_write_dirent(c, dir_f, rd, name, namelen, phys_ofs, ALLOC_NORMAL);
+	fd = jffs2_write_dirent(c, dir_f, rd, (unsigned char *)(name), namelen, phys_ofs, ALLOC_NORMAL);
 	
 	jffs2_free_raw_dirent(rd);
 
 	if (IS_ERR(fd)) {
 		jffs2_complete_reservation(c);
