Fix various places which cast a pointer to a uint64_t or vice versa.

GCC warns about the mismatched sizes on 32-bit platforms.

Reviewed by:	imp, markj
Differential Revision:	https://reviews.freebsd.org/D36752
This commit is contained in:
John Baldwin 2022-09-28 13:58:02 -07:00
parent 124e46735e
commit c5eed4146f
4 changed files with 8 additions and 8 deletions

View File

@ -131,7 +131,7 @@ zfsdev_ioctl(struct cdev *dev, ulong_t zcmd, caddr_t arg, int flag,
len = IOCPARM_LEN(zcmd);
vecnum = zcmd & 0xff;
zp = (void *)arg;
uaddr = (void *)zp->zfs_cmd;
uaddr = (void *)(uintptr_t)zp->zfs_cmd;
error = 0;
zcl = NULL;

View File

@ -290,7 +290,7 @@ iser_buf_to_sg(void *buf, struct iser_data_buf *data_buf)
offset = ((uintptr_t)buf) & ~PAGE_MASK;
len = min(PAGE_SIZE - offset, tlen);
sg_set_buf(sg, buf, len);
buf = (void *)(((u64)buf) + (u64)len);
buf = (void *)((uintptr_t)buf + len);
}
data_buf->size = i;

View File

@ -949,7 +949,7 @@ mana_gd_create_dma_region(struct gdma_dev *gd,
return EINVAL;
}
if (offset_in_page((uint64_t)gmi->virt_addr) != 0) {
if (offset_in_page((uintptr_t)gmi->virt_addr) != 0) {
mana_err(NULL, "gmi not page aligned: %p\n",
gmi->virt_addr);
return EINVAL;
@ -1508,19 +1508,19 @@ mana_gd_free_res_map(struct gdma_resource *r)
static void
mana_gd_init_registers(struct gdma_context *gc)
{
uint64_t bar0_va = rman_get_bushandle(gc->bar0);
uintptr_t bar0_va = rman_get_bushandle(gc->bar0);
vm_paddr_t bar0_pa = rman_get_start(gc->bar0);
gc->db_page_size = mana_gd_r32(gc, GDMA_REG_DB_PAGE_SIZE) & 0xFFFF;
gc->db_page_base =
(void *) (bar0_va + mana_gd_r64(gc, GDMA_REG_DB_PAGE_OFFSET));
(void *)(bar0_va + (size_t)mana_gd_r64(gc, GDMA_REG_DB_PAGE_OFFSET));
gc->phys_db_page_base =
bar0_pa + mana_gd_r64(gc, GDMA_REG_DB_PAGE_OFFSET);
gc->shm_base =
(void *) (bar0_va + mana_gd_r64(gc, GDMA_REG_SHM_OFFSET));
(void *)(bar0_va + (size_t)mana_gd_r64(gc, GDMA_REG_SHM_OFFSET));
mana_dbg(NULL, "db_page_size 0x%xx, db_page_base %p,"
" shm_base %p\n",

View File

@ -128,7 +128,7 @@ mana_hwc_post_rx_wqe(const struct hwc_wq *hwc_rxq,
int err;
sge = &req->sge;
sge->address = (uint64_t)req->buf_sge_addr;
sge->address = (uintptr_t)req->buf_sge_addr;
sge->mem_key = hwc_rxq->msg_buf->gpa_mkey;
sge->size = req->buf_len;
@ -616,7 +616,7 @@ mana_hwc_post_tx_wqe(const struct hwc_wq *hwc_txq,
tx_oob->vsq_id = hwc_txq->gdma_wq->id;
sge = &req->sge;
sge->address = (uint64_t)req->buf_sge_addr;
sge->address = (uintptr_t)req->buf_sge_addr;
sge->mem_key = hwc_txq->msg_buf->gpa_mkey;
sge->size = req->msg_size;