Linus Torvalds writes: (Summary) wrote:
That logic is still very non-obvious.
That logic is still very non-obvious.
This code already had one bug because of an odd illegible test sequence. Let's not keep the crazy code.
Why not just do the *obvious* thing, and get rid of "ret" entirely, and make the damn thing return a boolean, and then just write it all as
as
[...]
return ret;That logic is still very non-obvious.
That logic is still very non-obvious.
This code already had one bug because of an odd illegible test sequence. Let's not keep the crazy code.
Why not just do the *obvious* thing, and get rid of "ret" entirely, and make the damn thing return a boolean, and then just write it all as
as
/* Caller should have vq mutex and device mutex */ bool vhost_vq_access_ok(struct vhost_virtqueue *vq) { if (!vq_log_access_ok(vq, vq->log_base)) return false;