Utilize ARRAY_SIZE macro

This commit is contained in:
CTCaer
2020-11-15 13:56:45 +02:00
parent 55568b037f
commit 669e42960c
6 changed files with 11 additions and 10 deletions

View File

@@ -660,7 +660,7 @@ static kip1_id_t _kip_ids[] =
};
static kip1_id_t *_kip_id_sets = _kip_ids;
static u32 _kip_id_sets_cnt = sizeof(_kip_ids) / sizeof(_kip_ids[0]);
static u32 _kip_id_sets_cnt = ARRAY_SIZE(_kip_ids);
void pkg2_get_ids(kip1_id_t **ids, u32 *entries)
{
@@ -783,7 +783,7 @@ static void parse_external_kip_patches()
const pkg2_kernel_id_t *pkg2_identify(u8 *hash)
{
for (u32 i = 0; i < (sizeof(_pkg2_kernel_ids) / sizeof(pkg2_kernel_id_t)); i++)
for (u32 i = 0; i < ARRAY_SIZE(_pkg2_kernel_ids); i++)
{
if (!memcmp(hash, _pkg2_kernel_ids[i].hash, sizeof(_pkg2_kernel_ids[0].hash)))
return &_pkg2_kernel_ids[i];