mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-07 05:57:20 +00:00
clang-tidy: simplify boolean expression
Found with readability-simplify-boolean-expr Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
76f4dc436a
commit
20fa56d75d
@ -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,
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user