[Yaffs] Patch: some warnings

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Sergey Kubushyn
Date:  
To: yaffs-list
Subject: [Yaffs] Patch: some warnings
Hey,

I might be a bit late, Luc's sending patches faster than I am, but anyway...
This one is mostly cosmetic, it removes a bunch of warnings and makes kernel
leaner removing unnecessary functions. If something's already out, it might
point to what else should be deleted...

=== Cut ===
diff -urN linux-2.6.12.orig/fs/yaffs2/yaffs_fs.c linux-2.6.12/fs/yaffs2/yaffs_fs.c
--- linux-2.6.12.orig/fs/yaffs2/yaffs_fs.c    2005-07-26 17:07:45.000000000 -0700
+++ linux-2.6.12/fs/yaffs2/yaffs_fs.c    2005-07-26 18:17:29.000000000 -0700
@@ -1333,7 +1333,7 @@
     int nBlocks;
     struct inode * inode = NULL;
     struct dentry * root;
-    yaffs_Device *dev;
+    yaffs_Device *dev = NULL;
     int err;


     sb->s_magic = YAFFS_MAGIC;
@@ -1624,24 +1624,33 @@
 }



+#ifdef CONFIG_YAFFS_RAM_ENABLED
 static int yaffs_internal_read_super_ram(struct super_block * sb, void * data, int silent)
 {
      return yaffs_internal_read_super(1,1,sb,data,silent) ? 0 : -1;
 }
+#endif
+
+#ifdef CONFIG_YAFFS_MTD_ENABLED
 static int yaffs_internal_read_super_mtd(struct super_block * sb, void * data, int silent)
 {
      return yaffs_internal_read_super(1,0,sb,data,silent) ? 0 : -1;
 }
+#endif


+#ifdef CONFIG_YAFFS2_RAM_ENABLED
 static int yaffs2_internal_read_super_ram(struct super_block * sb, void * data, int silent)
 {
      return yaffs_internal_read_super(2,1,sb,data,silent) ? 0 : -1;
 }
+#endif
+
+#ifdef CONFIG_YAFFS2_MTD_ENABLED
 static int yaffs2_internal_read_super_mtd(struct super_block * sb, void * data, int silent)
 {
      return yaffs_internal_read_super(2,0,sb,data,silent) ? 0 : -1;
 }
-
+#endif



#ifdef CONFIG_YAFFS_MTD_ENABLED
@@ -1764,7 +1773,9 @@


static struct proc_dir_entry *my_proc_entry;
+#if defined CONFIG_YAFFS_RAM_ENABLED || defined CONFIG_YAFFS2_RAM_ENABLED
static struct proc_dir_entry *my_proc_ram_write_entry;
+#endif

static char * yaffs_dump_dev(char *buf,yaffs_Device *dev,char *name)
{
@@ -1830,6 +1841,7 @@
}


+#if defined CONFIG_YAFFS_RAM_ENABLED || defined CONFIG_YAFFS2_RAM_ENABLED
 static int  yaffs_proc_ram_write(
         char *page,
     char **start,
@@ -1843,7 +1855,7 @@
     printk(KERN_DEBUG "yaffs write size %d\n",count);
     return count;
 }
-
+#endif



 // Stuff to handle installation of file systems
diff -urN linux-2.6.12.orig/fs/yaffs2/yaffs_guts.h linux-2.6.12/fs/yaffs2/yaffs_guts.h
--- linux-2.6.12.orig/fs/yaffs2/yaffs_guts.h    2005-07-26 17:07:45.000000000 -0700
+++ linux-2.6.12/fs/yaffs2/yaffs_guts.h    2005-07-26 18:17:29.000000000 -0700
@@ -535,7 +535,7 @@
     int (*initialiseNAND)(struct yaffs_DeviceStruct *dev);


 #ifdef CONFIG_YAFFS_YAFFS2
-    int (*writeChunkWithTagsToNAND)(struct yaffs_DeviceStruct *dev,int chunkInNAND, const __u8 *data, yaffs_ExtendedTags *tags);
+    int (*writeChunkWithTagsToNAND)(struct yaffs_DeviceStruct *dev,int chunkInNAND, const __u8 *data, const yaffs_ExtendedTags *tags);
     int (*readChunkWithTagsFromNAND)(struct yaffs_DeviceStruct *dev,int chunkInNAND, __u8 *data, yaffs_ExtendedTags *tags);
     int (*markNANDBlockBad)(struct yaffs_DeviceStruct *dev, int blockNo);
     int (*queryNANDBlock)(struct yaffs_DeviceStruct *dev, int blockNo, yaffs_BlockState *state, int *sequenceNumber);
diff -urN linux-2.6.12.orig/fs/yaffs2/yaffs_tagscompat.c linux-2.6.12/fs/yaffs2/yaffs_tagscompat.c
--- linux-2.6.12.orig/fs/yaffs2/yaffs_tagscompat.c    2005-07-26 17:07:45.000000000 -0700
+++ linux-2.6.12/fs/yaffs2/yaffs_tagscompat.c    2005-07-26 18:21:09.000000000 -0700
@@ -19,11 +19,12 @@
 #include "yaffs_ecc.h"


static void yaffs_HandleReadDataError(yaffs_Device *dev,int chunkInNAND);
+#if 0
static void yaffs_CheckWrittenBlock(yaffs_Device *dev,int chunkInNAND);
static void yaffs_HandleWriteChunkOk(yaffs_Device *dev,int chunkInNAND,const __u8 *data, const yaffs_Spare *spare);
static void yaffs_HandleUpdateChunk(yaffs_Device *dev,int chunkInNAND, const yaffs_Spare *spare);
static void yaffs_HandleWriteChunkError(yaffs_Device *dev,int chunkInNAND);
-
+#endif


static const char yaffs_countBitsTable[256] =
@@ -307,7 +308,7 @@
}


-
+#if 0
static int yaffs_CheckChunkErased(struct yaffs_DeviceStruct *dev,int chunkInNAND)
{

@@ -332,7 +333,7 @@
     return YAFFS_OK;


}
-
+#endif

 #if 0
 int yaffs_EraseBlockInNAND(struct yaffs_DeviceStruct *dev,int blockInNAND)
@@ -480,7 +481,7 @@
     // NB recursion
 }


-
+#if 0
 static void yaffs_CheckWrittenBlock(yaffs_Device *dev,int chunkInNAND)
 {
 }
@@ -503,9 +504,6 @@
     yaffs_DeleteChunk(dev,chunkInNAND,1,__LINE__);
 }


-
-
-
static int yaffs_VerifyCompare(const __u8 *d0, const __u8 * d1, const yaffs_Spare *s0, const yaffs_Spare *s1)
{

@@ -531,6 +529,7 @@

     return 1;
 }
+#endif


#if 0
typedef struct
=== Cut ===

---
******************************************************************
*  KSI@home    KOI8 Net  < >  The impossible we do immediately.  *
*  Las Vegas   NV, USA   < >  Miracles require 24-hour notice.   *
******************************************************************