yaffsfs.c: Fix NULL dereference in yaffs_unmount2_reldev()
[yaffs2.git] / direct / test-framework / yaffs_fileem2k.c
index b9a00f1be619eb18245967fde2682dc1060c8e66..622129bfd2648b7ba509ef3760dcaa5d736dccc9 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
  *
- * Copyright (C) 2002-2011 Aleph One Ltd.
- *   for Toby Churchill Ltd and Brightstar Engineering
+ * Copyright (C) 2002-2018 Aleph One Ltd.
  *
  * Created by Charles Manning <charles@aleph1.co.uk>
  *
@@ -93,7 +92,6 @@ static int nops_so_far;
 
 int ops_multiplier;
 
-
 static void yflash2_MaybePowerFail(unsigned int nand_chunk, int failPoint)
 {
 
@@ -110,12 +108,6 @@ static void yflash2_MaybePowerFail(unsigned int nand_chunk, int failPoint)
   }
 }
 
-
-
-
-
-static u8 localBuffer[PAGE_SIZE];
-
 static char *NToName(char *buf,int n)
 {
        sprintf(buf,"emfile-2k-%d",n);
@@ -277,7 +269,7 @@ static int yflash2_ReadChunk(struct yaffs_dev *dev, int nand_chunk,
 
 static int yflash2_EraseBlock(struct yaffs_dev *dev, int block_no)
 {
-       int i;
+       u32 i;
        int h;
 
        CheckInit();
@@ -292,7 +284,6 @@ static int yflash2_EraseBlock(struct yaffs_dev *dev, int block_no)
 
                u8 pg[PAGE_SIZE];
                int syz = PAGE_SIZE;
-               int pos;
 
                memset(pg,0xff,syz);
 
@@ -303,7 +294,6 @@ static int yflash2_EraseBlock(struct yaffs_dev *dev, int block_no)
                {
                        write(h,pg,PAGE_SIZE);
                }
-               pos = lseek(h, 0,SEEK_CUR);
 
                return YAFFS_OK;
        }