1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-11-22 18:06:40 +00:00

nyx: bis: correct lookup check

This commit is contained in:
CTCaer 2021-10-15 16:50:56 +03:00
parent 3c81ac91df
commit d8670fbd87

View file

@ -137,7 +137,7 @@ static int nx_emmc_bis_write_block(u32 sector, u32 count, void *buff, bool flush
u32 aligned_sector = cluster * BIS_CLUSTER_SECTORS;
u32 sector_in_cluster = sector % BIS_CLUSTER_SECTORS;
u32 lookup_idx = cache_lookup_tbl[cluster];
bool is_cached = lookup_idx != BIS_CACHE_LOOKUP_TBL_EMPTY_ENTRY;
bool is_cached = lookup_idx != (u32)BIS_CACHE_LOOKUP_TBL_EMPTY_ENTRY;
// Write to cached cluster.
if (is_cached)
@ -264,7 +264,7 @@ static int nx_emmc_bis_read_block_cached(u32 sector, u32 count, void *buff)
u32 lookup_idx = cache_lookup_tbl[cluster];
// Read from cached cluster.
if (lookup_idx != BIS_CACHE_LOOKUP_TBL_EMPTY_ENTRY)
if (lookup_idx != (u32)BIS_CACHE_LOOKUP_TBL_EMPTY_ENTRY)
{
memcpy(buff, bis_cache->clusters[lookup_idx].data + sector_in_cluster * NX_EMMC_BLOCKSIZE, count * NX_EMMC_BLOCKSIZE);