Message ID | 1476285520-1985-1-git-send-email-thuth@redhat.com |
---|---|
State | New |
Headers | show |
On 12 October 2016 at 16:18, Thomas Huth <thuth@redhat.com> wrote: > The condition '!A || (A && B)' is equivalent to '!A || B'. > > Buglink: https://bugs.launchpad.net/qemu/+bug/1464611 > Signed-off-by: Thomas Huth <thuth@redhat.com> > --- > hw/block/nvme.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/block/nvme.c b/hw/block/nvme.c > index cef3bb4..53d9d2e 100644 > --- a/hw/block/nvme.c > +++ b/hw/block/nvme.c > @@ -373,7 +373,7 @@ static uint16_t nvme_create_sq(NvmeCtrl *n, NvmeCmd *cmd) > if (!cqid || nvme_check_cqid(n, cqid)) { > return NVME_INVALID_CQID | NVME_DNR; > } > - if (!sqid || (sqid && !nvme_check_sqid(n, sqid))) { > + if (!sqid || !nvme_check_sqid(n, sqid)) { > return NVME_INVALID_QID | NVME_DNR; > } > if (!qsize || qsize > NVME_CAP_MQES(n->bar.cap)) { > @@ -447,7 +447,7 @@ static uint16_t nvme_create_cq(NvmeCtrl *n, NvmeCmd *cmd) > uint16_t qflags = le16_to_cpu(c->cq_flags); > uint64_t prp1 = le64_to_cpu(c->prp1); > > - if (!cqid || (cqid && !nvme_check_cqid(n, cqid))) { > + if (!cqid || !nvme_check_cqid(n, cqid)) { > return NVME_INVALID_CQID | NVME_DNR; > } > if (!qsize || qsize > NVME_CAP_MQES(n->bar.cap)) { Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
On Wed, Oct 12, 2016 at 05:18:40PM +0200, Thomas Huth wrote: > The condition '!A || (A && B)' is equivalent to '!A || B'. > > Buglink: https://bugs.launchpad.net/qemu/+bug/1464611 > Signed-off-by: Thomas Huth <thuth@redhat.com> > --- > hw/block/nvme.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
12.10.2016 18:18, Thomas Huth wrote:
> The condition '!A || (A && B)' is equivalent to '!A || B'.
Applied to -trivial, thanks!
/mjt
diff --git a/hw/block/nvme.c b/hw/block/nvme.c index cef3bb4..53d9d2e 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -373,7 +373,7 @@ static uint16_t nvme_create_sq(NvmeCtrl *n, NvmeCmd *cmd) if (!cqid || nvme_check_cqid(n, cqid)) { return NVME_INVALID_CQID | NVME_DNR; } - if (!sqid || (sqid && !nvme_check_sqid(n, sqid))) { + if (!sqid || !nvme_check_sqid(n, sqid)) { return NVME_INVALID_QID | NVME_DNR; } if (!qsize || qsize > NVME_CAP_MQES(n->bar.cap)) { @@ -447,7 +447,7 @@ static uint16_t nvme_create_cq(NvmeCtrl *n, NvmeCmd *cmd) uint16_t qflags = le16_to_cpu(c->cq_flags); uint64_t prp1 = le64_to_cpu(c->prp1); - if (!cqid || (cqid && !nvme_check_cqid(n, cqid))) { + if (!cqid || !nvme_check_cqid(n, cqid)) { return NVME_INVALID_CQID | NVME_DNR; } if (!qsize || qsize > NVME_CAP_MQES(n->bar.cap)) {
The condition '!A || (A && B)' is equivalent to '!A || B'. Buglink: https://bugs.launchpad.net/qemu/+bug/1464611 Signed-off-by: Thomas Huth <thuth@redhat.com> --- hw/block/nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)