Patchwork [U-Boot,6/6] YAFFS2: fs/yaffs2/yaffs_guts.c - fix build warnings

login
register
mail settings
Submitter Wolfgang Denk
Date Sept. 8, 2011, 12:10 p.m.
Message ID <1315483822-25399-7-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/113895/
State Accepted
Commit 068d6f9a26080a5135ac064543bee09a062c4560
Headers show

Comments

Wolfgang Denk - Sept. 8, 2011, 12:10 p.m.
Fix these:
yaffs_guts.c: In function 'yaffs_ReadDataFromFile':
yaffs_guts.c:4622: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness
yaffs_guts.c:4622: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness
yaffs_guts.c: In function 'yaffs_WriteDataToFile':
yaffs_guts.c:4745: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness
yaffs_guts.c:4745: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness
yaffs_guts.c: In function 'yaffs_ResizeFile':
yaffs_guts.c:4968: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness
yaffs_guts.c:4968: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness
yaffs_guts.c: In function 'yaffs_GutsInitialise':
yaffs_guts.c:7235: warning: assignment from incompatible pointer type
yaffs_guts.c: In function 'yaffs_CreateNewObject':
yaffs_guts.c:2143: warning: 'tn' may be used uninitialized in this function
yaffs_guts.c: In function 'yaffs_MknodObject':
yaffs_guts.c:2258: warning: 'str' may be used uninitialized in this function

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 fs/yaffs2/yaffs_guts.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
Wolfgang Denk - Sept. 9, 2011, 10:01 p.m.
Dear Wolfgang Denk,

In message <1315483822-25399-7-git-send-email-wd@denx.de> you wrote:
> Fix these:
> yaffs_guts.c: In function 'yaffs_ReadDataFromFile':
> yaffs_guts.c:4622: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness
> yaffs_guts.c:4622: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness
> yaffs_guts.c: In function 'yaffs_WriteDataToFile':
> yaffs_guts.c:4745: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness
> yaffs_guts.c:4745: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness
> yaffs_guts.c: In function 'yaffs_ResizeFile':
> yaffs_guts.c:4968: warning: pointer targets in passing argument 3 of 'yaffs_AddrToChunk' differ in signedness
> yaffs_guts.c:4968: warning: pointer targets in passing argument 4 of 'yaffs_AddrToChunk' differ in signedness
> yaffs_guts.c: In function 'yaffs_GutsInitialise':
> yaffs_guts.c:7235: warning: assignment from incompatible pointer type
> yaffs_guts.c: In function 'yaffs_CreateNewObject':
> yaffs_guts.c:2143: warning: 'tn' may be used uninitialized in this function
> yaffs_guts.c: In function 'yaffs_MknodObject':
> yaffs_guts.c:2258: warning: 'str' may be used uninitialized in this function
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>  fs/yaffs2/yaffs_guts.c |   19 ++++++++++---------
>  1 files changed, 10 insertions(+), 9 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c
index fc86a5c..c67a085 100644
--- a/fs/yaffs2/yaffs_guts.c
+++ b/fs/yaffs2/yaffs_guts.c
@@ -2140,7 +2140,7 @@  yaffs_Object *yaffs_CreateNewObject(yaffs_Device * dev, int number,
 {
 
 	yaffs_Object *theObject;
-	yaffs_Tnode *tn;
+	yaffs_Tnode *tn = NULL;
 
 	if (number < 0) {
 		number = yaffs_CreateNewObjectNumber(dev);
@@ -2255,7 +2255,7 @@  static yaffs_Object *yaffs_MknodObject(yaffs_ObjectType type,
 				       const YCHAR * aliasString, __u32 rdev)
 {
 	yaffs_Object *in;
-	YCHAR *str;
+	YCHAR *str = NULL;
 
 	yaffs_Device *dev = parent->myDev;
 
@@ -4605,8 +4605,8 @@  int yaffs_ReadDataFromFile(yaffs_Object * in, __u8 * buffer, loff_t offset,
 			   int nBytes)
 {
 
-	int chunk;
-	int start;
+	__u32 chunk;
+	__u32 start;
 	int nToCopy;
 	int n = nBytes;
 	int nDone = 0;
@@ -4725,8 +4725,8 @@  int yaffs_WriteDataToFile(yaffs_Object * in, const __u8 * buffer, loff_t offset,
 			  int nBytes, int writeThrough)
 {
 
-	int chunk;
-	int start;
+	__u32 chunk;
+	__u32 start;
 	int nToCopy;
 	int n = nBytes;
 	int nDone = 0;
@@ -4960,8 +4960,8 @@  int yaffs_ResizeFile(yaffs_Object * in, loff_t newSize)
 {
 
 	int oldFileSize = in->variant.fileVariant.fileSize;
-	int newSizeOfPartialChunk;
-	int newFullChunks;
+	__u32 newSizeOfPartialChunk;
+	__u32 newFullChunks;
 
 	yaffs_Device *dev = in->myDev;
 
@@ -7232,7 +7232,8 @@  int yaffs_GutsInitialise(yaffs_Device * dev)
 			dev->nShortOpCaches = YAFFS_MAX_SHORT_OP_CACHES;
 		}
 
-		buf = dev->srCache =  YMALLOC(srCacheBytes);
+		dev->srCache = YMALLOC(srCacheBytes);
+		buf = (__u8 *)dev->srCache;
 
 		if(dev->srCache)
 			memset(dev->srCache,0,srCacheBytes);