From: Charles Manning Date: Tue, 25 May 2021 22:45:13 +0000 (+1200) Subject: Index the block state string list because the order was wrong. X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=0376d8e0e88bb969c42723135477a8a8d6409e93 Index the block state string list because the order was wrong. Thanks to Cory Wiltshire for pointing out the problem and proposing a fix. Signed-off-by: Charles Manning --- diff --git a/yaffs_verify.c b/yaffs_verify.c index ba9b9f4..e634b50 100644 --- a/yaffs_verify.c +++ b/yaffs_verify.c @@ -36,16 +36,16 @@ static int yaffs_skip_nand_verification(struct yaffs_dev *dev) } static const char * const block_state_name[] = { - "Unknown", - "Needs scan", - "Scanning", - "Empty", - "Allocating", - "Full", - "Dirty", - "Checkpoint", - "Collecting", - "Dead" + [YAFFS_BLOCK_STATE_UNKNOWN] = "Unknown", + [YAFFS_BLOCK_STATE_NEEDS_SCAN] = "Needs scan", + [YAFFS_BLOCK_STATE_SCANNING] = "Scanning", + [YAFFS_BLOCK_STATE_EMPTY] = "Empty", + [YAFFS_BLOCK_STATE_ALLOCATING] = "Allocating", + [YAFFS_BLOCK_STATE_FULL] = "Full", + [YAFFS_BLOCK_STATE_DIRTY] = "Dirty", + [YAFFS_BLOCK_STATE_CHECKPOINT] = "Checkpoint", + [YAFFS_BLOCK_STATE_COLLECTING] = "Collecting", + [YAFFS_BLOCK_STATE_DEAD] = "Dead" }; void yaffs_verify_blk(struct yaffs_dev *dev, struct yaffs_block_info *bi, int n)