Quantcast
Channel: lkml.org : Pallipadi, Venkatesh
Viewing all articles
Browse latest Browse all 864

Re: [PATCH] vhost: fix vhost_vq_access_ok() log check

$
0
0
Linus Torvalds writes: (Summary) wrote:

[...]

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;

Viewing all articles
Browse latest Browse all 864

Trending Articles