Commit 986bb0e6 authored by Simon Glass's avatar Simon Glass Committed by Wolfgang Denk
Browse files

Fix warnings in yaffs



Sorry if this is already fixed somewhere - I could not find it.

This fixes the warnings show below.

yaffs_tagscompat.c: In function 'yaffs_TagsCompatabilityReadChunkWithTagsFromNAND':
yaffs_tagscompat.c:151: warning: dereferencing pointer 'tu' does break strict-aliasing rules
yaffs_tagscompat.c:150: warning: dereferencing pointer 'tu' does break strict-aliasing rules
yaffs_tagscompat.c:149: warning: dereferencing pointer 'tu' does break strict-aliasing rules
yaffs_tagscompat.c:148: warning: dereferencing pointer 'tu' does break strict-aliasing rules
yaffs_tagscompat.c:147: warning: dereferencing pointer 'tu' does break strict-aliasing rules
yaffs_tagscompat.c:146: warning: dereferencing pointer 'tu' does break strict-aliasing rules
yaffs_tagscompat.c:145: warning: dereferencing pointer 'tu' does break strict-aliasing rules
yaffs_tagscompat.c:144: warning: dereferencing pointer 'tu' does break strict-aliasing rules
yaffs_tagscompat.c:141: note: initialized from here

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent f45e91c4
...@@ -136,9 +136,8 @@ static void yaffs_LoadTagsIntoSpare(yaffs_Spare * sparePtr, ...@@ -136,9 +136,8 @@ static void yaffs_LoadTagsIntoSpare(yaffs_Spare * sparePtr,
} }
static void yaffs_GetTagsFromSpare(yaffs_Device * dev, yaffs_Spare * sparePtr, static void yaffs_GetTagsFromSpare(yaffs_Device * dev, yaffs_Spare * sparePtr,
yaffs_Tags * tagsPtr) yaffs_TagsUnion *tu)
{ {
yaffs_TagsUnion *tu = (yaffs_TagsUnion *) tagsPtr;
int result; int result;
tu->asBytes[0] = sparePtr->tagByte0; tu->asBytes[0] = sparePtr->tagByte0;
...@@ -150,7 +149,7 @@ static void yaffs_GetTagsFromSpare(yaffs_Device * dev, yaffs_Spare * sparePtr, ...@@ -150,7 +149,7 @@ static void yaffs_GetTagsFromSpare(yaffs_Device * dev, yaffs_Spare * sparePtr,
tu->asBytes[6] = sparePtr->tagByte6; tu->asBytes[6] = sparePtr->tagByte6;
tu->asBytes[7] = sparePtr->tagByte7; tu->asBytes[7] = sparePtr->tagByte7;
result = yaffs_CheckECCOnTags(tagsPtr); result = yaffs_CheckECCOnTags(&tu->asTags);
if (result > 0) { if (result > 0) {
dev->tagsEccFixed++; dev->tagsEccFixed++;
} else if (result < 0) { } else if (result < 0) {
...@@ -437,7 +436,7 @@ int yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(yaffs_Device * dev, ...@@ -437,7 +436,7 @@ int yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(yaffs_Device * dev,
{ {
yaffs_Spare spare; yaffs_Spare spare;
yaffs_Tags tags; yaffs_TagsUnion tags;
yaffs_ECCResult eccResult; yaffs_ECCResult eccResult;
static yaffs_Spare spareFF; static yaffs_Spare spareFF;
...@@ -467,10 +466,10 @@ int yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(yaffs_Device * dev, ...@@ -467,10 +466,10 @@ int yaffs_TagsCompatabilityReadChunkWithTagsFromNAND(yaffs_Device * dev,
if (eTags->chunkUsed) { if (eTags->chunkUsed) {
yaffs_GetTagsFromSpare(dev, &spare, &tags); yaffs_GetTagsFromSpare(dev, &spare, &tags);
eTags->objectId = tags.objectId; eTags->objectId = tags.asTags.objectId;
eTags->chunkId = tags.chunkId; eTags->chunkId = tags.asTags.chunkId;
eTags->byteCount = tags.byteCount; eTags->byteCount = tags.asTags.byteCount;
eTags->serialNumber = tags.serialNumber; eTags->serialNumber = tags.asTags.serialNumber;
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment