hw/block/nvme: Simplify if-statements a little bit
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> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
0a04e11f32
commit
f96fe6b5c2
@ -375,7 +375,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)) {
|
||||
@ -449,7 +449,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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user