clang-tidy: simplify boolean expression

Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2020-10-05 03:19:13 -07:00 committed by Frediano Ziglio
parent 76f4dc436a
commit 20fa56d75d
2 changed files with 7 additions and 15 deletions

View File

@ -1440,11 +1440,7 @@ bool red_validate_surface(uint32_t width, uint32_t height,
/* the multiplication can overflow, also abs(-2^31) may return a negative value */
size = (uint64_t) height * abs(stride);
if (size > MAX_DATA_CHUNK) {
return false;
}
return true;
return size <= MAX_DATA_CHUNK;
}
static bool red_get_surface_cmd(QXLInstance *qxl_instance, RedMemSlotInfo *slots, int group_id,

View File

@ -146,16 +146,12 @@ StreamDevice::partial_read()
}
}
if (handled || has_error) {
// Qemu put the device on blocking state if we don't read all data
// so schedule another read.
// We arrive here if we processed that entire message or we
// got an error, try to read another message or discard the
// wrong data
return true;
}
return false;
// Qemu put the device on blocking state if we don't read all data
// so schedule another read.
// We arrive here if we processed that entire message or we
// got an error, try to read another message or discard the
// wrong data
return handled || has_error;
}
RedPipeItemPtr StreamDevice::read_one_msg_from_device()