static int yaffs_errno = 0;
-
-
void yaffs_bug_fn(const char *fn, int n)
{
printf("yaffs bug at %s:%d\n", fn, n);
void yaffsfs_SetError(int err)
{
- //Do whatever to set error
yaffs_errno = err;
}
void yaffsfs_LocalInitialisation(void)
{
- // Define locking semaphore.
+ /* No locking used */
}
-static const char * yaffs_file_type_str(struct yaffs_stat *stat)
+static const char *yaffs_file_type_str(struct yaffs_stat *stat)
{
switch(stat->st_mode & S_IFMT) {
case S_IFREG: return "regular file";
}
}
-static const char * yaffs_error_str(void)
+static const char *yaffs_error_str(void)
{
int error = yaffsfs_GetLastError();
(x <= b && b <= y);
}
-void cmd_yaffs_devconfig(char *_mp, int flash_dev, int start_block, int end_block)
+void cmd_yaffs_devconfig(char *_mp, int flash_dev,
+ int start_block, int end_block)
{
struct mtd_info *mtd = NULL;
struct yaffs_dev *dev = NULL;
printf("Flash device invalid\n");
goto err;
}
-
- if(end_block == 0)
+
+ if (end_block == 0)
end_block = mtd->size / mtd->erasesize - 1;
- if(end_block < start_block) {
+ if (end_block < start_block) {
printf("Bad start/end\n");
goto err;
}
/* Check for any conflicts */
yaffs_dev_rewind();
- while(1) {
+ while (1) {
chk = yaffs_next_dev();
if(!chk)
break;
yaffs_add_device(dev);
printf("Configures yaffs mount %s: dev %d start block %d, end block %d %s\n",
- mp, flash_dev, start_block, end_block,
+ mp, flash_dev, start_block, end_block,
dev->param.inband_tags ? "using inband tags" : "");
return;
dev = yaffs_next_dev();
if(!dev)
return;
- flash_dev = ((unsigned) dev->driver_context - (unsigned) nand_info)/
+ flash_dev =
+ ((unsigned) dev->driver_context - (unsigned) nand_info)/
sizeof(nand_info[0]);
printf("%-10s %5d 0x%05x 0x%05x %s",
dev->param.name, flash_dev,
int i;
unsigned char buffer[100];
- outh = yaffs_open(yaffsName, O_CREAT | O_RDWR | O_TRUNC, S_IREAD | S_IWRITE);
- if (outh < 0)
- {
+ outh = yaffs_open(yaffsName,
+ O_CREAT | O_RDWR | O_TRUNC,
+ S_IREAD | S_IWRITE);
+ if (outh < 0) {
printf("Error opening file: %d. %s\n", outh, yaffs_error_str());
return;
}