openocd: fix simple cases of NULL comparison
[fw/openocd] / src / jtag / drivers / mpsse.c
index 9ba1e2502de746474cda4ef2aef27126c51a41b2..4e64fdbbfaaac0b7ec57ecaa5dec99c14894a54c 100644 (file)
@@ -119,7 +119,7 @@ static bool device_location_equal(struct libusb_device *device, const char *loca
        LOG_DEBUG("device path has %i steps", path_len);
 
        ptr = strtok(loc, "-:");
-       if (ptr == NULL) {
+       if (!ptr) {
                LOG_DEBUG("no ':' in path");
                goto done;
        }
@@ -131,7 +131,7 @@ static bool device_location_equal(struct libusb_device *device, const char *loca
        path_step = 0;
        while (path_step < 7) {
                ptr = strtok(NULL, ".,");
-               if (ptr == NULL) {
+               if (!ptr) {
                        LOG_DEBUG("no more tokens in path at step %i", path_step);
                        break;
                }