{
struct serial8250_device *dev = &devices[0];
- if (pthread_mutex_lock(&dev->mutex) < 0)
+ if (pthread_mutex_lock(&dev->mutex) != 0)
die("pthread_mutex_lock");
serial8250__receive(self, dev);
kvm__irq_line(self, dev->irq, 1);
}
- if (pthread_mutex_unlock(&dev->mutex) < 0)
+ if (pthread_mutex_unlock(&dev->mutex) != 0)
die("pthread_mutex_unlock");
}
if (!dev)
return false;
- if (pthread_mutex_lock(&dev->mutex) < 0)
+ if (pthread_mutex_lock(&dev->mutex) != 0)
die("pthread_mutex_lock");
offset = port - dev->iobase;
}
out_unlock:
- if (pthread_mutex_unlock(&dev->mutex) < 0)
+ if (pthread_mutex_unlock(&dev->mutex) != 0)
die("pthread_mutex_unlock");
return ret;
if (!dev)
return false;
- if (pthread_mutex_lock(&dev->mutex) < 0)
+ if (pthread_mutex_lock(&dev->mutex) != 0)
die("pthread_mutex_lock");
offset = port - dev->iobase;
goto out_unlock;
}
out_unlock:
- if (pthread_mutex_unlock(&dev->mutex) < 0)
+ if (pthread_mutex_unlock(&dev->mutex) != 0)
die("pthread_mutex_unlock");
return ret;
unsigned long offset;
bool ret = true;
- if (pthread_mutex_lock(&blk_device.mutex) < 0)
+ if (pthread_mutex_lock(&blk_device.mutex) != 0)
die("pthread_mutex_lock");
offset = port - IOPORT_VIRTIO_BLK;
};
out_unlock:
- if (pthread_mutex_unlock(&blk_device.mutex) < 0)
+ if (pthread_mutex_unlock(&blk_device.mutex) != 0)
die("pthread_mutex_unlock");
return ret;
unsigned long offset;
bool ret = true;
- if (pthread_mutex_lock(&blk_device.mutex) < 0)
+ if (pthread_mutex_lock(&blk_device.mutex) != 0)
die("pthread_mutex_lock");
offset = port - IOPORT_VIRTIO_BLK;
};
out_unlock:
- if (pthread_mutex_unlock(&blk_device.mutex) < 0)
+ if (pthread_mutex_unlock(&blk_device.mutex) != 0)
die("pthread_mutex_unlock");
return ret;