[Yaffs] [PATCH] Fix constness of spare argument.

Top Page
Attachments:
Message as email
+ (text/plain)
+ 15-fix-constness-of-spare-arguments.diff (text/plain)
Delete this message
Reply to this message
Author: Luc Van Oostenryck
Date:  
To: yaffs
Subject: [Yaffs] [PATCH] Fix constness of spare argument.
Fix declaration of nandemul_WriteChunkToNAND() & nandmtd_WriteChunkToNAND().

In yaffs_guts.h the 4th argument of writeChunkToNAND is declared as "const yaffs_Spare *spare".
Do the same for nandemul_WriteChunkToNAND() & nandmtd_WriteChunkToNAND().
diff --git a/fs/yaffs2/yaffs_mtdif.c b/fs/yaffs2/yaffs_mtdif.c
--- a/fs/yaffs2/yaffs_mtdif.c
+++ b/fs/yaffs2/yaffs_mtdif.c
@@ -38,7 +38,7 @@ struct nand_oobinfo yaffs_noeccinfo = {
};


-int nandmtd_WriteChunkToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, yaffs_Spare *spare)
+int nandmtd_WriteChunkToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, const yaffs_Spare *spare)
 {
     struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice);
     size_t dummy;
diff --git a/fs/yaffs2/yaffs_mtdif.h b/fs/yaffs2/yaffs_mtdif.h
--- a/fs/yaffs2/yaffs_mtdif.h
+++ b/fs/yaffs2/yaffs_mtdif.h
@@ -22,7 +22,7 @@


#include "yaffs_guts.h"

-int nandmtd_WriteChunkToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, yaffs_Spare *spare);
+int nandmtd_WriteChunkToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, const yaffs_Spare *spare);
int nandmtd_ReadChunkFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaffs_Spare *spare);
int nandmtd_EraseBlockInNAND(yaffs_Device *dev, int blockNumber);
int nandmtd_InitialiseNAND(yaffs_Device *dev);
diff --git a/fs/yaffs2/yaffs_nandemul.h b/fs/yaffs2/yaffs_nandemul.h
--- a/fs/yaffs2/yaffs_nandemul.h
+++ b/fs/yaffs2/yaffs_nandemul.h
@@ -29,7 +29,7 @@
* transferred.
*/

-int nandemul_WriteChunkToNAND(struct yaffs_DeviceStruct *dev,int chunkInNAND, const __u8 *data, yaffs_Spare *spare);
+int nandemul_WriteChunkToNAND(struct yaffs_DeviceStruct *dev,int chunkInNAND, const __u8 *data, const yaffs_Spare *spare);
 int nandemul_ReadChunkFromNAND(struct yaffs_DeviceStruct *dev,int chunkInNAND, __u8 *data, yaffs_Spare *spare);
 int nandemul_EraseBlockInNAND(struct yaffs_DeviceStruct *dev,int blockInNAND);
 int nandemul_InitialiseNAND(struct yaffs_DeviceStruct *dev);
diff --git a/fs/yaffs2/yaffs_ramem.c b/fs/yaffs2/yaffs_ramem.c
--- a/fs/yaffs2/yaffs_ramem.c
+++ b/fs/yaffs2/yaffs_ramem.c
@@ -180,7 +180,7 @@ static int  CheckInit(void)
     return 1;
 }


-int nandemul_WriteChunkToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, yaffs_Spare *spare)
+int nandemul_WriteChunkToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, const yaffs_Spare *spare)
 {
     int blk;
     int pg;