Replace explicit sizeof divisions by ARRAY_SIZE.

This commit is contained in:
Vladimir Serbinenko 2015-01-20 12:45:45 +01:00
parent ba3031f996
commit 59d4036594
6 changed files with 16 additions and 14 deletions

View file

@ -99,7 +99,7 @@ find_free_slot (void)
{
unsigned int i;
for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
for (i = 0; i < ARRAY_SIZE (map); i++)
if (! map[i].drive)
return i;
@ -115,7 +115,7 @@ grub_util_biosdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
if (pull != GRUB_DISK_PULL_NONE)
return 0;
for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
for (i = 0; i < ARRAY_SIZE (map); i++)
if (map[i].drive && hook (map[i].drive, hook_data))
return 1;
@ -581,7 +581,7 @@ grub_util_biosdisk_fini (void)
{
unsigned i;
for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
for (i = 0; i < ARRAY_SIZE(map); i++)
{
if (map[i].drive)
free (map[i].drive);