openocd: use macro ARRAY_SIZE()
[fw/openocd] / src / jtag / drivers / xds110.c
index c49280743afd678d7fcbadf9ea64a7a143e6a940..85a1b81db1339a3b03b35881442bbac5ed388974 100644 (file)
@@ -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;