mirror of
https://github.com/qemu/qemu.git
synced 2024-11-26 21:33:40 +08:00
remove unnecessary casts from uintptr_t
uintptr_t, or unsigned long which is equivalent on Linux I32LP64 systems, is an unsigned type and there is no need to further cast to __u64 which is another unsigned integer type; widening casts from unsigned integers zero-extend the value. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
729ba8e933
commit
592d0bc030
@ -102,7 +102,7 @@ static void luring_resubmit_short_read(LuringState *s, LuringAIOCB *luringcb,
|
||||
|
||||
/* Update sqe */
|
||||
luringcb->sqeq.off += nread;
|
||||
luringcb->sqeq.addr = (__u64)(uintptr_t)luringcb->resubmit_qiov.iov;
|
||||
luringcb->sqeq.addr = (uintptr_t)luringcb->resubmit_qiov.iov;
|
||||
luringcb->sqeq.len = luringcb->resubmit_qiov.niov;
|
||||
|
||||
luring_resubmit(s, luringcb);
|
||||
|
@ -1000,7 +1000,7 @@ vfio_device_feature_dma_logging_start_create(VFIOContainerBase *bcontainer,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
control->ranges = (__u64)(uintptr_t)ranges;
|
||||
control->ranges = (uintptr_t)ranges;
|
||||
if (tracking->max32) {
|
||||
ranges->iova = tracking->min32;
|
||||
ranges->length = (tracking->max32 - tracking->min32) + 1;
|
||||
@ -1126,7 +1126,7 @@ static int vfio_device_dma_logging_report(VFIODevice *vbasedev, hwaddr iova,
|
||||
report->iova = iova;
|
||||
report->length = size;
|
||||
report->page_size = qemu_real_host_page_size();
|
||||
report->bitmap = (__u64)(uintptr_t)bitmap;
|
||||
report->bitmap = (uintptr_t)bitmap;
|
||||
|
||||
feature->argsz = sizeof(buf);
|
||||
feature->flags = VFIO_DEVICE_FEATURE_GET |
|
||||
|
@ -167,7 +167,7 @@ sev_ioctl(int fd, int cmd, void *data, int *error)
|
||||
|
||||
input.id = cmd;
|
||||
input.sev_fd = fd;
|
||||
input.data = (__u64)(unsigned long)data;
|
||||
input.data = (uintptr_t)data;
|
||||
|
||||
r = kvm_vm_ioctl(kvm_state, KVM_MEMORY_ENCRYPT_OP, &input);
|
||||
|
||||
@ -240,7 +240,7 @@ sev_ram_block_added(RAMBlockNotifier *n, void *host, size_t size,
|
||||
return;
|
||||
}
|
||||
|
||||
range.addr = (__u64)(unsigned long)host;
|
||||
range.addr = (uintptr_t)host;
|
||||
range.size = max_size;
|
||||
|
||||
trace_kvm_memcrypt_register_region(host, max_size);
|
||||
@ -270,7 +270,7 @@ sev_ram_block_removed(RAMBlockNotifier *n, void *host, size_t size,
|
||||
return;
|
||||
}
|
||||
|
||||
range.addr = (__u64)(unsigned long)host;
|
||||
range.addr = (uintptr_t)host;
|
||||
range.size = max_size;
|
||||
|
||||
trace_kvm_memcrypt_unregister_region(host, max_size);
|
||||
@ -767,7 +767,7 @@ sev_launch_update_data(SevGuestState *sev, uint8_t *addr, uint64_t len)
|
||||
return 1;
|
||||
}
|
||||
|
||||
update.uaddr = (__u64)(unsigned long)addr;
|
||||
update.uaddr = (uintptr_t)addr;
|
||||
update.len = len;
|
||||
trace_kvm_sev_launch_update_data(addr, len);
|
||||
ret = sev_ioctl(sev->sev_fd, KVM_SEV_LAUNCH_UPDATE_DATA,
|
||||
|
@ -180,7 +180,7 @@ static void add_poll_remove_sqe(AioContext *ctx, AioHandler *node)
|
||||
struct io_uring_sqe *sqe = get_sqe(ctx);
|
||||
|
||||
#ifdef LIBURING_HAVE_DATA64
|
||||
io_uring_prep_poll_remove(sqe, (__u64)(uintptr_t)node);
|
||||
io_uring_prep_poll_remove(sqe, (uintptr_t)node);
|
||||
#else
|
||||
io_uring_prep_poll_remove(sqe, node);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user