target/linux/generic/files/drivers/mtd/nand/mtk_bmt_nmbm.c
static void nmbm_build_mapping_table(struct nmbm_instance *ni)
{
	uint32_t pb, lb;

	for (pb = 0, lb = 0; pb < ni->mgmt_start_ba; pb++) {
		if (nmbm_get_block_state(ni, pb) == BLOCK_ST_BAD)
			continue;

		/* Always map to the next good block */
		ni->block_mapping[lb++] = pb;
	}

	ni->data_block_count = lb;

	/* Unusable/Management blocks */
	for (pb = lb; pb < ni->block_count; pb++)
		ni->block_mapping[pb] = -1;
}
/*
 * nmbm_build_mapping_table - Build initial block mapping table
 * @ni: NMBM instance structure
 *
 * The initial mapping table will be compatible with the stratage of
 * factory production.
 */
Build initial block mapping table
@ni: NMBM instance structure

The initial mapping table will be compatible with the stratage of
factory production.
Build initial block mapping table @ni : NMBM instance structure The initial mapping table will be compatible with the stratage of factory production .
static void nmbm_build_mapping_table(struct nmbm_instance *ni)
{
	uint32_t pb, lb;
	for (pb = 0, lb = 0; pb < ni->mgmt_start_ba; pb++) {
		if (nmbm_get_block_state(ni, pb) == BLOCK_ST_BAD)
			continue;
		ni->block_mapping[lb++] = pb;
	}
	ni->data_block_count = lb;
	for (pb = lb; pb < ni->block_count; pb++)
		ni->block_mapping[pb] = -1;
}
static void nmbm_build_mapping_table ( struct nmbm_instance * ni ) { uint32_t pb , lb ; for ( pb = 0 , lb = 0 ; pb < ni -> mgmt_start_ba ; pb ++ ) { if ( nmbm_get_block_state ( ni , pb ) == BLOCK_ST_BAD ) continue ; ni -> block_mapping [ lb ++ ] = pb ; } ni -> data_block_count = lb ; for ( pb = lb ; pb < ni -> block_count ; pb ++ ) ni -> block_mapping [ pb ] = -1 ; }
nmbm_build_mapping_table - Build initial block mapping table
 @ni: NMBM instance structure
nmbm_build_mapping_table - Build initial block mapping table @ni : NMBM instance structure
/* Always map to the next good block */ /* Unusable/Management blocks */