use ARRAY_SIZE macro

Search and destroy lingering cases where the ARRAY_SIZE macro should
be used to convey more intrinsic meaning in the OpenOCD code.
This commit is contained in:
Zachary T Welch
2009-11-24 20:32:10 -08:00
parent a3d81eed4d
commit 4946925bea
10 changed files with 36 additions and 36 deletions
+2 -2
View File
@@ -290,7 +290,7 @@ static int avrf_probe(struct flash_bank *bank)
LOG_ERROR("0x%" PRIx32 " is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F);
}
for (i = 0; i < (int)(sizeof(avft_chips_info) / sizeof(avft_chips_info[0])); i++)
for (i = 0; i < (int)ARRAY_SIZE(avft_chips_info); i++)
{
if (avft_chips_info[i].chip_id == EXTRACT_PART(device_id))
{
@@ -369,7 +369,7 @@ static int avrf_info(struct flash_bank *bank, char *buf, int buf_size)
LOG_ERROR("0x%" PRIx32 " is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F);
}
for (i = 0; i < (int)(sizeof(avft_chips_info) / sizeof(avft_chips_info[0])); i++)
for (i = 0; i < (int)ARRAY_SIZE(avft_chips_info); i++)
{
if (avft_chips_info[i].chip_id == EXTRACT_PART(device_id))
{