X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fflash%2Favrf.c;h=687dd4b59ea2acf79bf263bfe9ee47532d938ae4;hb=4946925bea77a4aace6c310b2b724cf2095c6719;hp=1c484643c06b9dd708b8f50855d64eeeb096acfb;hpb=a3d81eed4d2aac51056f36d7c00ee639bb39c552;p=fw%2Fopenocd diff --git a/src/flash/avrf.c b/src/flash/avrf.c index 1c484643c..687dd4b59 100644 --- a/src/flash/avrf.c +++ b/src/flash/avrf.c @@ -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)) {