rem: len = file->len<card->sector_size?card->sector_size:file->len; if(__card_read(chn,(file->iblock*card->sector_size),len,card->cmd_usr_buf,__read_callback)>=0) return;  } } else ret = CARD_ERROR_CANCELED;
add: } else ret = CARD_ERROR_CANCELED; }
context: static void __read_callback(u32 chn,s32 result){	s32 ret;	u32 len;	cardcallback cb = NULL;	card_file *file = NULL;	card_block *card = 0;	struct card_bat *fatblock = NULL;#ifdef _CARD_DEBUG	printf("__read_callback(%d,%d)\n",chn,result);#endif	if(chn<EXI_CHANNEL_0 || chn>=EXI_CHANNEL_2) return;	card = &cardmap[chn];	ret = result;	file = card->curr_file;	if(ret>=0 && file->len>=0) {		file->len = file->len-(((file->offset+card->sector_size)&~(card->sector_size-1))-file->offset);		if(file->len>0) {			fatblock = __card_getbatblock(card);			file->offset += (((file->offset+card->sector_size)&~(card->sector_size-1))-file->offset);			file->iblock = fatblock->fat[file->iblock-CARD_SYSAREA];			if(file->iblock<CARD_SYSAREA || file->iblock>=card->blocks) {				ret = CARD_ERROR_BROKEN;				goto exit;			}			len = file->len<card->sector_size?card->sector_size:file->len;			if(__card_read(chn,(file->iblock*card->sector_size),len,card->cmd_usr_buf,__read_callback)>=0) return;					}	} else		ret = CARD_ERROR_CANCELED;exit:	cb = card->card_api_cb;	card->card_api_cb = NULL;	__card_putcntrlblock(card,ret);	if(cb) cb(chn,ret);}