drivers/versaloon: use ARRAY_SIZE()

Replace the custom macro dimof() with the OpenOCD macro
ARRAY_SIZE().

Change-Id: I2fe638444f6c16f2a78c1fd558b21550f76282d6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6259
Tested-by: jenkins
Reviewed-by: Xiang W <wxjstz@126.com>
This commit is contained in:
Antonio Borneo 2020-08-24 11:40:13 +02:00
parent 4e872a797f
commit 8f6dd512c7
2 changed files with 1 additions and 2 deletions

View File

@ -124,7 +124,7 @@ void versaloon_free_want_pos(void)
} }
versaloon_want_pos = NULL; versaloon_want_pos = NULL;
for (i = 0; i < dimof(versaloon_pending); i++) { for (i = 0; i < ARRAY_SIZE(versaloon_pending); i++) {
tmp = versaloon_pending[i].pos; tmp = versaloon_pending[i].pos;
while (tmp != NULL) { while (tmp != NULL) {
free_tmp = tmp; free_tmp = tmp;

View File

@ -27,7 +27,6 @@
#define PARAM_CHECK 1 #define PARAM_CHECK 1
#define sleep_ms(ms) jtag_sleep((ms) * 1000) #define sleep_ms(ms) jtag_sleep((ms) * 1000)
#define dimof(arr) (sizeof(arr) / sizeof((arr)[0]))
#define TO_STR(name) #name #define TO_STR(name) #name
#define RESULT int #define RESULT int