From owner-svn-src-head@freebsd.org Wed Dec 16 00:17:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A09754A97D9; Wed, 16 Dec 2020 00:17:55 +0000 (UTC) (envelope-from jhb@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CwbLW46Kpz3Q98; Wed, 16 Dec 2020 00:17:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 803971CC7B; Wed, 16 Dec 2020 00:17:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0BG0HtP5040958; Wed, 16 Dec 2020 00:17:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0BG0HtGN040957; Wed, 16 Dec 2020 00:17:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202012160017.0BG0HtGN040957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 16 Dec 2020 00:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368687 - head/sys/dev/mxge X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/mxge X-SVN-Commit-Revision: 368687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2020 00:17:55 -0000 Author: jhb Date: Wed Dec 16 00:17:54 2020 New Revision: 368687 URL: https://svnweb.freebsd.org/changeset/base/368687 Log: Use uintptr_t instead of unsigned long for integers holding pointers. Reviewed by: imp, gallatin Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27580 Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Wed Dec 16 00:13:32 2020 (r368686) +++ head/sys/dev/mxge/if_mxge.c Wed Dec 16 00:17:54 2020 (r368687) @@ -772,7 +772,7 @@ mxge_dummy_rdma(mxge_softc_t *sc, int enable) uint32_t *buf, dma_low, dma_high; int i; - buf = (uint32_t *)((unsigned long)(buf_bytes + 7) & ~7UL); + buf = (uint32_t *)((uintptr_t)(buf_bytes + 7) & ~7UL); /* clear confirmation addr */ confirm = (volatile uint32_t *)sc->cmd; @@ -825,7 +825,7 @@ mxge_send_cmd(mxge_softc_t *sc, uint32_t cmd, mxge_cmd int err, sleep_total = 0; /* ensure buf is aligned to 8 bytes */ - buf = (mcp_cmd_t *)((unsigned long)(buf_bytes + 7) & ~7UL); + buf = (mcp_cmd_t *)((uintptr_t)(buf_bytes + 7) & ~7UL); buf->data0 = htobe32(data->data0); buf->data1 = htobe32(data->data1); @@ -944,7 +944,7 @@ mxge_load_firmware(mxge_softc_t *sc, int adopt) uint32_t *buf, size, dma_low, dma_high; int status, i; - buf = (uint32_t *)((unsigned long)(buf_bytes + 7) & ~7UL); + buf = (uint32_t *)((uintptr_t)(buf_bytes + 7) & ~7UL); size = sc->sram_size; status = mxge_load_firmware_helper(sc, &size); @@ -3373,7 +3373,7 @@ mxge_alloc_slice_rings(struct mxge_slice_state *ss, in ss->tx.req_bytes = malloc(bytes, M_DEVBUF, M_WAITOK); /* ensure req_list entries are aligned to 8 bytes */ ss->tx.req_list = (mcp_kreq_ether_send_t *) - ((unsigned long)(ss->tx.req_bytes + 7) & ~7UL); + ((uintptr_t)(ss->tx.req_bytes + 7) & ~7UL); /* allocate the tx busdma segment list */ bytes = sizeof (*ss->tx.seg_list) * ss->tx.max_desc;