openocd: use macro ARRAY_SIZE()
[fw/openocd] / src / flash / nor / stm32lx.c
index 3cb1a499824a23bd0473754b7368559b7743e167..b014d097dc92fbe221f3163699813a71b6c7a1c1 100644 (file)
@@ -533,8 +533,8 @@ static int stm32lx_write_half_pages(struct flash_bank *bank, const uint8_t *buff
                buf_set_u32(reg_params[2].value, 0, 32, this_count / 4);
 
                /* 5: Execute the bunch of code */
-               retval = target_run_algorithm(target, 0, NULL, sizeof(reg_params)
-                               / sizeof(*reg_params), reg_params,
+               retval = target_run_algorithm(target, 0, NULL,
+                               ARRAY_SIZE(reg_params), reg_params,
                                write_algorithm->address, 0, 10000, &armv7m_info);
                if (retval != ERROR_OK)
                        break;