yaffs Added some more tests to timothy_tests.
[yaffs2.git] / direct / basic-test / yaffs_ramdisk.c
index babddde..5d389b9 100644 (file)
@@ -79,7 +79,7 @@ static int  CheckInit(struct yaffs_dev *dev)
        
        ramdisk.nBlocks = (SIZE_IN_MB * 1024 * 1024)/(16 * 1024);
        
-       ramdisk.block = YMALLOC(sizeof(yramdisk_block *) * ramdisk.nBlocks);
+       ramdisk.block = malloc(sizeof(yramdisk_block *) * ramdisk.nBlocks);
        
        if(!ramdisk.block) return 0;
        
@@ -90,7 +90,7 @@ static int  CheckInit(struct yaffs_dev *dev)
        
        for(i=0; i <ramdisk.nBlocks && !fail; i++)
        {
-               if((ramdisk.block[i] = YMALLOC(sizeof(yramdisk_block))) == 0)
+               if((ramdisk.block[i] = malloc(sizeof(yramdisk_block))) == 0)
                {
                        fail = 1;
                }
@@ -105,12 +105,13 @@ static int  CheckInit(struct yaffs_dev *dev)
        {
                for(i = 0; i < nAllocated; i++)
                {
-                       YFREE(ramdisk.block[i]);
+                       kfree(ramdisk.block[i]);
                }
-               YFREE(ramdisk.block);
+               kfree(ramdisk.block);
                
-               T(YAFFS_TRACE_ALWAYS,("Allocation failed, could only allocate %dMB of %dMB requested.\n",
-                  nAllocated/64,ramdisk.nBlocks * 528));
+               yaffs_trace(YAFFS_TRACE_ALWAYS,
+                       "Allocation failed, could only allocate %dMB of %dMB requested.\n",
+                       nAllocated/64,ramdisk.nBlocks * 528);
                return 0;
        }
        
@@ -212,7 +213,9 @@ int yramdisk_erase(struct yaffs_dev *dev, int blockNumber)
        
        if(blockNumber < 0 || blockNumber >= ramdisk.nBlocks)
        {
-               T(YAFFS_TRACE_ALWAYS,("Attempt to erase non-existant block %d\n",blockNumber));
+               yaffs_trace(YAFFS_TRACE_ALWAYS,
+                       "Attempt to erase non-existant block %d\n",
+                       blockNumber);
                return YAFFS_FAIL;
        }
        else
@@ -231,4 +234,3 @@ int yramdisk_initialise(struct yaffs_dev *dev)
        return YAFFS_OK;
 }
 
-