From nobody Wed Sep 28 21:06:39 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Md8Dv5Q67z4V4hW; Wed, 28 Sep 2022 21:06:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Md8Dv4hlsz3Cqc; Wed, 28 Sep 2022 21:06:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664399199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sF2dbVa6BRzfrMWvPfEl6KieDkFRQlFGODl70bJsfqY=; b=ub2OkULUqAIkjWqbysTqUi6rnIyFOI3hG1GJR2TsKxMGw6fzG6yq/X/qiMo1GBdJOfsjvu mVLHs7y53aTYUuvhoEIjQq2ck3mQ4YDtduOdkI6skaRPvWyCY/ypMLwZ7rXP6KA2nMuHy2 RhSzet8PvKZI3vD3vR0rp+1oDWgMgG4dACFthT4VB+wu/kLhM6iq5WH0H/nKB9FVUNCOQf b+CaDwApo8ICgfhDa1Xdz9NIeQFi39tzrqWcUuhEW72mlrURyMzwtSu1hnnTMPmUdm6EU6 ufAnSQhmvwfJEE66Pl12r/zGUM8Z8ktwYuu6iuGxWsgihzU/vmlBr5Jvr8+zMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Md8Dv3khyzbsv; Wed, 28 Sep 2022 21:06:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28SL6dc3037387; Wed, 28 Sep 2022 21:06:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28SL6dqK037386; Wed, 28 Sep 2022 21:06:39 GMT (envelope-from git) Date: Wed, 28 Sep 2022 21:06:39 GMT Message-Id: <202209282106.28SL6dqK037386@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c5eed4146fc9 - main - Fix various places which cast a pointer to a uint64_t or vice versa. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5eed4146fc9ac6abeef9e26f6675e86d0888443 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664399199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sF2dbVa6BRzfrMWvPfEl6KieDkFRQlFGODl70bJsfqY=; b=BYLvxFGvbdrJ82cGyYsjGULQ6pK0J8ECB9AdX74yFbeaBKunQTpKXkcvMU2SWxI4zQ8JNQ eiKCzE0q3wBThcLxd/7kM5mKOUQzuA/D19pSNAVoQhAE9Y3fouiyqaqGgY7fRD2Gw6rgR5 OaauGFRlMbZVmuVV/niBbHtWIliy/G+groBqkYzsDGm1mugHhDDAu12qcAYbpvT2vI2c3c U+kjG0vAKsiFQSyQ4XguDa/cmvn/q/90JKIZdTJy4o6QQXqyTEuAx1t80TirJXLncg/2Pj CC57kkR2U2kbK038R0W1pZMkVQlTVC62r/WxbSBRdc4YjCGOUGqbLkAWAuTPSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664399199; a=rsa-sha256; cv=none; b=n1gsg0Z10f5HjLDmEshy5LrFjoYS3V6hAO9eEr38I+8B2HpJRt0J5c8IgtwL+Qr+fWqQXA pL7wuwJOC8SezvpUaUELbBUYlbPhVwbFR1L5jqDdXSfsf7LQwkQpu8U5rkq1+jHhdqTLZB rhgRlnVfCYqlycECMMbR3ibUWu5HJnMbjc1QLHbRHBCs3Gx1oR/vrozTYvesLrM9weyKvA ICNDVt4TVOgIaP+vhxMFvSZDC0h1fCr9sX935k1Fe5yS/Jco6NLHzUVtvFpu8vHc+HWcRr J2CieBXp2nacAEZGiYon5AjSgaPfYbzx/Hmcje1a+jv3V9J618a/BcWfJiqdlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c5eed4146fc9ac6abeef9e26f6675e86d0888443 commit c5eed4146fc9ac6abeef9e26f6675e86d0888443 Author: John Baldwin AuthorDate: 2022-09-28 20:58:02 +0000 Commit: John Baldwin CommitDate: 2022-09-28 20:58:02 +0000 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 --- sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c | 2 +- sys/dev/iser/iser_initiator.c | 2 +- sys/dev/mana/gdma_main.c | 8 ++++---- sys/dev/mana/hw_channel.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c b/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c index 020ef6a39b5e..0a19fbba717d 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/kmod_core.c @@ -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; diff --git a/sys/dev/iser/iser_initiator.c b/sys/dev/iser/iser_initiator.c index 49960c29a614..4e426240c882 100644 --- a/sys/dev/iser/iser_initiator.c +++ b/sys/dev/iser/iser_initiator.c @@ -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; diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c index 60ddde142f44..6bda6eae13eb 100644 --- a/sys/dev/mana/gdma_main.c +++ b/sys/dev/mana/gdma_main.c @@ -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", diff --git a/sys/dev/mana/hw_channel.c b/sys/dev/mana/hw_channel.c index 19e25a8a49ab..845a47eac96a 100644 --- a/sys/dev/mana/hw_channel.c +++ b/sys/dev/mana/hw_channel.c @@ -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;