openocd: use macro ARRAY_SIZE()
There are still few cases where the macro ARRAY_SIZE() should be used in place of custom code. Use ARRAY_SIZE() whenever possible. Change-Id: Iba0127a02357bc704fe639e08562a4f9aa7011df Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6260 Reviewed-by: Xiang W <wxjstz@126.com> Tested-by: jenkins
This commit is contained in:
@@ -356,7 +356,7 @@ static bool usb_connect(void)
|
||||
/* Check for device vid/pid match */
|
||||
libusb_get_device_descriptor(list[i], &desc);
|
||||
match = false;
|
||||
for (device = 0; device < sizeof(vids)/sizeof(vids[0]); device++) {
|
||||
for (device = 0; device < ARRAY_SIZE(vids); device++) {
|
||||
if (desc.idVendor == vids[device] &&
|
||||
desc.idProduct == pids[device]) {
|
||||
match = true;
|
||||
|
||||
Reference in New Issue
Block a user