pvr: Use ~0 for masks instead of ~0U.

This makes code future proof in case someone changes the type
and also avoids half masks (0x00000000FFFFFFFF) in case of
64bit variables.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal@imgtec.com>
Reported-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18707>
This commit is contained in:
Rajnesh Kanwal
2022-08-04 14:05:44 +01:00
parent 10b6a0d567
commit 7eff950215
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -306,7 +306,7 @@ static uint32_t pvr_encode_direct_write(
static uint32_t
pvr_find_constant2(uint8_t *const_usage, uint8_t words, const char *const_name)
{
uint32_t const_index = ~0U;
uint32_t const_index = ~0;
uint32_t step = words;
uint8_t mask = (1 << words) - 1;
@@ -325,7 +325,7 @@ pvr_find_constant2(uint8_t *const_usage, uint8_t words, const char *const_name)
}
unreachable("Unexpected: Space cannot be found for constant");
return ~0U;
return ~0;
}
#define PVR_MAX_PDS_TEMPS 32
@@ -138,7 +138,7 @@ static VkResult pvr_srv_sync_wait_many(struct vk_device *device,
if (!poll_fds)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
if (abs_timeout_ns != 0U && abs_timeout_ns != ~0U) {
if (abs_timeout_ns != 0UL && abs_timeout_ns != ~0) {
/* Syncobj timeouts are signed. */
abs_timeout_ns = MIN2(abs_timeout_ns, (uint64_t)INT64_MAX);
pvr_start_timeout(&end_time, abs_timeout_ns);
@@ -172,7 +172,7 @@ static VkResult pvr_srv_sync_wait_many(struct vk_device *device,
/* FIXME: Fix device loss handling. */
do {
if (abs_timeout_ns == ~0U) {
if (abs_timeout_ns == ~0) {
ppoll_ret = ppoll(poll_fds, wait_count, NULL, NULL);
} else {
struct timespec remaining_time;