From: Marek Vasut Date: Mon, 24 Oct 2011 23:41:37 +0000 (+0000) Subject: GCC4.6: Drop dead code from yaffs_guts.c X-Git-Tag: v2011.12-rc1~350 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b41478c6688f539949ea3e8ecada0ab5fcbcf40;p=platform%2Fkernel%2Fu-boot.git GCC4.6: Drop dead code from yaffs_guts.c Drop yaffs_DeleteWorker(): yaffs_guts.c:1556:12: warning: 'yaffs_DeleteWorker' defined but not used Drop yaffs_VerifyTnodeWorker(): yaffs_guts.c:600:12: warning: 'yaffs_VerifyTnodeWorker' defined but not used Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Simon Glass Cc: Mike Frysinger --- diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c index c67a085..68422e2 100644 --- a/fs/yaffs2/yaffs_guts.c +++ b/fs/yaffs2/yaffs_guts.c @@ -78,8 +78,6 @@ static int yaffs_UpdateObjectHeader(yaffs_Object * in, const YCHAR * name, int force, int isShrink, int shadows); static void yaffs_RemoveObjectFromDirectory(yaffs_Object * obj); static int yaffs_CheckStructures(void); -static int yaffs_DeleteWorker(yaffs_Object * in, yaffs_Tnode * tn, __u32 level, - int chunkOffset, int *limit); static int yaffs_DoGenericObjectDeletion(yaffs_Object * in); static yaffs_BlockInfo *yaffs_GetBlockInfo(yaffs_Device * dev, int blockNo); @@ -595,55 +593,6 @@ static void yaffs_VerifyObjectHeader(yaffs_Object *obj, yaffs_ObjectHeader *oh, obj->objectId)); } - - -static int yaffs_VerifyTnodeWorker(yaffs_Object * obj, yaffs_Tnode * tn, - __u32 level, int chunkOffset) -{ - int i; - yaffs_Device *dev = obj->myDev; - int ok = 1; - - if (tn) { - if (level > 0) { - - for (i = 0; i < YAFFS_NTNODES_INTERNAL && ok; i++){ - if (tn->internal[i]) { - ok = yaffs_VerifyTnodeWorker(obj, - tn->internal[i], - level - 1, - (chunkOffset<objectId; - - chunkOffset <<= YAFFS_TNODES_LEVEL0_BITS; - - for(i = 0; i < YAFFS_NTNODES_LEVEL0; i++){ - __u32 theChunk = yaffs_GetChunkGroupBase(dev,tn,i); - - if(theChunk > 0){ - /* T(~0,(TSTR("verifying (%d:%d) %d"TENDSTR),tags.objectId,tags.chunkId,theChunk)); */ - yaffs_ReadChunkWithTagsFromNAND(dev,theChunk,NULL, &tags); - if(tags.objectId != objectId || tags.chunkId != chunkOffset){ - T(~0,(TSTR("Object %d chunkId %d NAND mismatch chunk %d tags (%d:%d)"TENDSTR), - objectId, chunkOffset, theChunk, - tags.objectId, tags.chunkId)); - } - } - chunkOffset++; - } - } - } - - return ok; - -} - - static void yaffs_VerifyFile(yaffs_Object *obj) { int requiredTallness; @@ -1546,104 +1495,6 @@ static int yaffs_FindChunkInGroup(yaffs_Device * dev, int theChunk, return -1; } - -/* DeleteWorker scans backwards through the tnode tree and deletes all the - * chunks and tnodes in the file - * Returns 1 if the tree was deleted. - * Returns 0 if it stopped early due to hitting the limit and the delete is incomplete. - */ - -static int yaffs_DeleteWorker(yaffs_Object * in, yaffs_Tnode * tn, __u32 level, - int chunkOffset, int *limit) -{ - int i; - int chunkInInode; - int theChunk; - yaffs_ExtendedTags tags; - int foundChunk; - yaffs_Device *dev = in->myDev; - - int allDone = 1; - - if (tn) { - if (level > 0) { - - for (i = YAFFS_NTNODES_INTERNAL - 1; allDone && i >= 0; - i--) { - if (tn->internal[i]) { - if (limit && (*limit) < 0) { - allDone = 0; - } else { - allDone = - yaffs_DeleteWorker(in, - tn-> - internal - [i], - level - - 1, - (chunkOffset - << - YAFFS_TNODES_INTERNAL_BITS) - + i, - limit); - } - if (allDone) { - yaffs_FreeTnode(dev, - tn-> - internal[i]); - tn->internal[i] = NULL; - } - } - - } - return (allDone) ? 1 : 0; - } else if (level == 0) { - int hitLimit = 0; - - for (i = YAFFS_NTNODES_LEVEL0 - 1; i >= 0 && !hitLimit; - i--) { - theChunk = yaffs_GetChunkGroupBase(dev,tn,i); - if (theChunk) { - - chunkInInode = - (chunkOffset << - YAFFS_TNODES_LEVEL0_BITS) + i; - - foundChunk = - yaffs_FindChunkInGroup(dev, - theChunk, - &tags, - in->objectId, - chunkInInode); - - if (foundChunk > 0) { - yaffs_DeleteChunk(dev, - foundChunk, 1, - __LINE__); - in->nDataChunks--; - if (limit) { - *limit = *limit - 1; - if (*limit <= 0) { - hitLimit = 1; - } - } - - } - - yaffs_PutLevel0Tnode(dev,tn,i,0); - } - - } - return (i < 0) ? 1 : 0; - - } - - } - - return 1; - -} - static void yaffs_SoftDeleteChunk(yaffs_Device * dev, int chunk) {