yaffs More quick tests and have also fixed a bugin yaffs_mount function.
[yaffs2.git] / mtdemul / nandemul2k.c
index 7efa8d45d6e383f0764413d14e7d5f341014a99a..4cba57b536dedc5c879807e674470d14dbbbab84 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
  *
- * Copyright (C) 2002-2007 Aleph One Ltd.
+ * Copyright (C) 2002-2010 Aleph One Ltd.
  *   for Toby Churchill Ltd and Brightstar Engineering
  *
  * Created by Charles Manning <charles@aleph1.co.uk>
@@ -66,7 +66,7 @@ static struct mtd_info nandemul2k_mtd;
 
 typedef struct 
 {
-       __u8 data[PAGE_TOTAL_SIZE]; // Data + spare
+       u8 data[PAGE_TOTAL_SIZE]; // Data + spare
        int empty;      // is this empty?
 } nandemul_Page;
 
@@ -99,32 +99,32 @@ static void nandemul_yield(int n)
 }
 
 
-static void nandemul2k_Read(void *buffer, int page, int start, int nBytes)
+static void nandemul2k_Read(void *buffer, int page, int start, int n_bytes)
 {
        int pg = page%PAGES_PER_BLOCK;
        int blk = page/PAGES_PER_BLOCK;
-       if(buffer && nBytes > 0)
+       if(buffer && n_bytes > 0)
        {
-               memcpy(buffer,&ned.block[blk]->page[pg]->data[start],nBytes);
+               memcpy(buffer,&ned.block[blk]->page[pg]->data[start],n_bytes);
        }
        
 }
 
-static void nandemul2k_Program(const void *buffer, int page, int start, int nBytes)
+static void nandemul2k_Program(const void *buffer, int page, int start, int n_bytes)
 {
        int pg = page%PAGES_PER_BLOCK;
        int blk = page/PAGES_PER_BLOCK;
-       __u8 *p;
-       __u8 *b = (__u8 *)buffer;
+       u8 *p;
+       u8 *b = (u8 *)buffer;
 
        p = &ned.block[blk]->page[pg]->data[start];
        
-       while(buffer && nBytes>0)
+       while(buffer && n_bytes>0)
        {
                *p = *p & *b;
                p++;
                b++;
-               nBytes--;
+               n_bytes--;
        }
 }
 
@@ -255,7 +255,7 @@ int nandemul2k_GetNumberOfBlocks(void) {return nandemul2k_CalcNBlocks();}
 
 
 
-static int nandemul2k_ReadId(__u8 *vendorId, __u8 *deviceId)
+static int nandemul2k_ReadId(u8 *vendorId, u8 *deviceId)
 {
        *vendorId = 'Y'; 
        *deviceId = '2';
@@ -264,7 +264,7 @@ static int nandemul2k_ReadId(__u8 *vendorId, __u8 *deviceId)
 }
 
 
-static int nandemul2k_ReadStatus(__u8 *status)
+static int nandemul2k_ReadStatus(u8 *status)
 {
                *status = 0;
                return 1;