target/linux/generic/files/drivers/mtd/nand/mtk_bmt_nmbm.c
static bool nmbm_block_walk_desc(struct nmbm_instance *ni, uint32_t ba,
				 uint32_t *nba, uint32_t count, uint32_t limit)
{
	int32_t nblock = count;

	if (limit >= ni->block_count)
		limit = ni->block_count - 1;

	while (ba > limit) {
		if (nmbm_get_block_state(ni, ba) == BLOCK_ST_GOOD)
			nblock--;

		if (nblock < 0) {
			*nba = ba;
			return true;
		}

		ba--;
	}

	return false;
}
/*
 * nmbm_block_walk_desc - Skip specified number of good blocks, descending addr
 * @ni: NMBM instance structure
 * @ba: start physical block address
 * @nba: return physical block address after walk
 * @count: number of good blocks to be skipped
 * @limit: lowest block address allowed for walking
 *
 * Start from @ba, skipping any bad blocks, counting @count good blocks, and
 * return the next good block address.
 *
 * If no enough good blocks counted while @limit reached, false will be returned.
 *
 * If @count == 0, nearest good block address will be returned.
 * @limit is not counted in walking.
 */


Start from @ba, skipping any bad blocks, counting @count good blocks, and
return the next good block address.

If no enough good blocks counted while @limit reached, false will be returned.

If @count == 0, nearest good block address will be returned.
@limit is not counted in walking.
Start from @ba skipping any bad blocks counting @count good blocks and return the next good block address . If no enough good blocks counted while @limit reached false will be returned . If @count == 0 nearest good block address will be returned . @limit is not counted in walking .
static bool nmbm_block_walk_desc(struct nmbm_instance *ni, uint32_t ba,
				 uint32_t *nba, uint32_t count, uint32_t limit)
{
	int32_t nblock = count;
	if (limit >= ni->block_count)
		limit = ni->block_count - 1;
	while (ba > limit) {
		if (nmbm_get_block_state(ni, ba) == BLOCK_ST_GOOD)
			nblock--;
		if (nblock < 0) {
			*nba = ba;
			return true;
		}
		ba--;
	}
	return false;
}
static bool nmbm_block_walk_desc ( struct nmbm_instance * ni , uint32_t ba , uint32_t * nba , uint32_t count , uint32_t limit ) { int32_t nblock = count ; if ( limit >= ni -> block_count ) limit = ni -> block_count - 1 ; while ( ba > limit ) { if ( nmbm_get_block_state ( ni , ba ) == BLOCK_ST_GOOD ) nblock -- ; if ( nblock < 0 ) { * nba = ba ; return true ; } ba -- ; } return false ; }
nmbm_block_walk_desc - Skip specified number of good blocks, descending addr
 @ni: NMBM instance structure
 @ba: start physical block address
 @nba: return physical block address after walk
 @count: number of good blocks to be skipped
 @limit: lowest block address allowed for walking
nmbm_block_walk_desc - Skip specified number of good blocks descending addr @ni : NMBM instance structure @ba : start physical block address @nba : return physical block address after walk @count : number of good blocks to be skipped @limit : lowest block address allowed for walking