From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/7] GCC4.6: Drop dead code from yaffs_guts.c
Date: Tue, 25 Oct 2011 11:41:37 +0200 [thread overview]
Message-ID: <1319535702-20929-3-git-send-email-marek.vasut@gmail.com> (raw)
In-Reply-To: <1319535702-20929-1-git-send-email-marek.vasut@gmail.com>
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 <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Mike Frysinger <vapier@gentoo.org>
---
fs/yaffs2/yaffs_guts.c | 149 ------------------------------------------------
1 files changed, 0 insertions(+), 149 deletions(-)
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<<YAFFS_TNODES_INTERNAL_BITS) + i);
- }
- }
- } else if (level == 0) {
- int i;
- yaffs_ExtendedTags tags;
- __u32 objectId = obj->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)
{
--
1.7.6.3
next prev parent reply other threads:[~2011-10-25 9:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-25 9:41 [U-Boot] [PATCH 0/7] CLEANUP: Cleanup of misc remaining things found Marek Vasut
2011-10-25 9:41 ` [U-Boot] [PATCH 1/7] GCC4.6: Squash warnings in LzmaTools.c Marek Vasut
2011-10-27 22:02 ` Wolfgang Denk
2011-10-25 9:41 ` Marek Vasut [this message]
2011-10-27 22:02 ` [U-Boot] [PATCH 2/7] GCC4.6: Drop dead code from yaffs_guts.c Wolfgang Denk
2011-10-25 9:41 ` [U-Boot] [PATCH 3/7] GCC4.6: Squash warnings in yaffs_guts.c Marek Vasut
2011-10-27 22:03 ` Wolfgang Denk
2011-10-25 9:41 ` [U-Boot] [PATCH 4/7] GCC4.6: Squash warning in tegra2 board.c Marek Vasut
2011-10-27 22:03 ` Wolfgang Denk
2011-10-25 9:41 ` [U-Boot] [PATCH 5/7] GCC4.6: Squash warnings in omap4 clocks.c Marek Vasut
2011-10-27 22:03 ` Wolfgang Denk
2011-10-25 9:41 ` [U-Boot] [PATCH 6/7] GCC4.6: Remove debugX() usage from spc1920 hpi Marek Vasut
2011-10-27 22:03 ` Wolfgang Denk
2011-10-25 9:41 ` [U-Boot] [PATCH 7/7] DEBUG: Fix debug macros Marek Vasut
2011-10-27 22:03 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1319535702-20929-3-git-send-email-marek.vasut@gmail.com \
--to=marek.vasut@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox