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

	while (nblocks >= min_count) {
		success = nmbm_block_walk(ni, true, ba, nba, nblocks, limit);
		if (success)
			return true;

		nblocks--;
	}

	return false;
}
/*
 * nmbm_try_reserve_blocks - Reserve blocks with compromisation
 * @ni: NMBM instance structure
 * @ba: start physical block address
 * @nba: return physical block address after reservation
 * @count: number of good blocks to be skipped
 * @min_count: minimum number of good blocks to be skipped
 * @limit: highest/lowest block address allowed for walking
 *
 * Reserve specific blocks. If failed, try to reserve as many as possible.
 */


Reserve specific blocks. If failed, try to reserve as many as possible.
Reserve specific blocks . If failed try to reserve as many as possible .
static bool nmbm_try_reserve_blocks(struct nmbm_instance *ni, uint32_t ba,
				    uint32_t *nba, uint32_t count,
				    int32_t min_count, int32_t limit)
{
	int32_t nblocks = count;
	bool success;
	while (nblocks >= min_count) {
		success = nmbm_block_walk(ni, true, ba, nba, nblocks, limit);
		if (success)
			return true;
		nblocks--;
	}
	return false;
}
static bool nmbm_try_reserve_blocks ( struct nmbm_instance * ni , uint32_t ba , uint32_t * nba , uint32_t count , int32_t min_count , int32_t limit ) { int32_t nblocks = count ; bool success ; while ( nblocks >= min_count ) { success = nmbm_block_walk ( ni , true , ba , nba , nblocks , limit ) ; if ( success ) return true ; nblocks -- ; } return false ; }
nmbm_try_reserve_blocks - Reserve blocks with compromisation
 @ni: NMBM instance structure
 @ba: start physical block address
 @nba: return physical block address after reservation
 @count: number of good blocks to be skipped
 @min_count: minimum number of good blocks to be skipped
 @limit: highest/lowest block address allowed for walking
nmbm_try_reserve_blocks - Reserve blocks with compromisation @ni : NMBM instance structure @ba : start physical block address @nba : return physical block address after reservation @count : number of good blocks to be skipped @min_count : minimum number of good blocks to be skipped @limit : highest / lowest block address allowed for walking