[Yaffs] [PATCH] Fix constness of writeChunkWithTagsToNAND

Top Page
Attachments:
Message as email
+ (text/plain)
+ 14-fix-constness-in-decl-of-writeChunkWithTagsToNAND.diff (text/plain)
Delete this message
Reply to this message
Author: Luc Van Oostenryck
Date:  
To: yaffs
Subject: [Yaffs] [PATCH] Fix constness of writeChunkWithTagsToNAND
Fix constness mixup in the declaration of writeChunkWithTagsToNAND.

In yaffs_guts.h the i4th arg of the writeChunkWithTagsToNAND method is
declared as "yaffs_ExtendedTags *" but in the correspondig implementation:
nandmtd2_WriteChunkWithTagsToNAND() & nandemul2k_WriteChunkWithTagsToNAND()
the same argument is declared as an const pointer of the same type.

Change the declaration of writeChunkWithTagsToNAND to also use the const.
diff --git a/fs/yaffs2/yaffs_guts.h b/fs/yaffs2/yaffs_guts.h
--- a/fs/yaffs2/yaffs_guts.h
+++ b/fs/yaffs2/yaffs_guts.h
@@ -534,7 +534,7 @@ struct yaffs_DeviceStruct
     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);