From nobody Fri Nov 11 18:36:30 2022 X-Original-To: dev-commits-src-branches@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 4N86qL5g4bz4dbLT; Fri, 11 Nov 2022 18:36:30 +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 4N86qL58Rcz3tQB; Fri, 11 Nov 2022 18:36:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668191790; 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=uqlImmqrtS90RKg8H0SJzZw/trIfVcwXqRVfasWsKlA=; b=SNQfiVQlbJ6+f7Zq2KH/LzU0v9wcj4ZqwD/BuuKcq//FkOLon+Zympt9LRkjWUekW5kjQW IY6U6VMcqBzO0pJ2lcDWKe4J1BOTErY0VGabrwzZTswMB6BDxIjOaA+Mj8U5pLGYrdA2qr tlOZxS6VVLQH7F02jAxUZtWs0wrWVcCSayelhLPuxV0NZLDG+ag7BnzwCc5eInqC5Nu8a7 ESIumAIGdEVYYI+lGlbzpaUurR0CcW71mrAaFVFdbOii6RspFiRHuW4SfMMj7OdXGUf8po Z8VK1Nb7bo/MW3KFyrnpmQb5I6p4nHi+hN3vaNEJLyY9qvz4vwJKDPOQby2BJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668191790; 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=uqlImmqrtS90RKg8H0SJzZw/trIfVcwXqRVfasWsKlA=; b=n4Jxl52YrEkI04TTVu/aCfkLEqa4j8WLRBaL0aOtzkdAYgw5lO63lBb6SRekrB2d3OMB4a ioYt7h3IAvxnlagHOhck64ZjiTupZOhs0BceZJymXgsPtAj9ebboC1SJNw4szStL7CN+UB R6F0nEL7eg9ImG5fhjC8fiXLJR+YMetMQU/c20osW/HbBneObGAD8JodTFaAL8wfTuMuMu s4r3Tf9uOZIcKaiAOwlg72rL2wOocA2xUwZRpWp6mfizcf5GrPTW42+OsAjTzoHVO7XiMY eVY3wb7BJJJ8qC0qOngvUkoEj4yeb0yCwLosvQfVlWrxH+7tfu8M+3oqBMitkA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668191790; a=rsa-sha256; cv=none; b=XVeOJo3cbcnZOPR17thC04ayB/e7yIsic2F0lLIdt9jrvIvnMfmaAvYH9sZbuKxNwFnriF Ah1AydSy1vekoGwnX4YobTsx6f+3NrRPrE71NUjxIy4myxATle92LW+yY9YIESxYF24QY3 w2z2PtlifxhJ5a+fG0pu9zjvVfhxhQXz9JPLB1DAqYeJLU6kBaEIDYH/8o9PygHK2swwBN DuZBi1OUAPHOi1+taSSpoxbGnxSEuE36sLxt40y7b/Fdqg4p56GG+LYWYYWf9ZoEe2niDH RaKoID2u9mXWsnh4mz2wbEVLUOo03JT36/RyOaLQvQSDGMtgMPYg+sZpMvh27g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N86qL49VgztHD; Fri, 11 Nov 2022 18:36:30 +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 2ABIaU0B003673; Fri, 11 Nov 2022 18:36:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ABIaUtv003672; Fri, 11 Nov 2022 18:36:30 GMT (envelope-from git) Date: Fri, 11 Nov 2022 18:36:30 GMT Message-Id: <202211111836.2ABIaUtv003672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 54c65cbb2475 - stable/13 - ntb: Use uintmax_t casts and %j to print physical addresses. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 54c65cbb2475f2d94fc94e7584b7cee5e8486d7f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=54c65cbb2475f2d94fc94e7584b7cee5e8486d7f commit 54c65cbb2475f2d94fc94e7584b7cee5e8486d7f Author: John Baldwin AuthorDate: 2022-09-28 20:56:31 +0000 Commit: John Baldwin CommitDate: 2022-11-11 18:18:52 +0000 ntb: Use uintmax_t casts and %j to print physical addresses. This fixes -Wint-to-pointer-cast errors with GCC when compiling on i386 where physical addresses are not the same size as pointers. Reviewed by: mav, imp Differential Revision: https://reviews.freebsd.org/D36751 (cherry picked from commit 124e46735e07037afafbf0caa097faafb09c7329) --- sys/dev/ntb/ntb_hw/ntb_hw_amd.c | 6 +++--- sys/dev/ntb/ntb_hw/ntb_hw_intel.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_amd.c b/sys/dev/ntb/ntb_hw/ntb_hw_amd.c index 450a3a2fa2b8..fc77e39ae1a0 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw_amd.c +++ b/sys/dev/ntb/ntb_hw/ntb_hw_amd.c @@ -1112,10 +1112,10 @@ static void print_map_success(struct amd_ntb_softc *ntb, struct amd_ntb_pci_bar_info *bar, const char *kind) { - amd_ntb_printf(0, "Mapped BAR%d v:[%p-%p] p:[%p-%p] (0x%jx bytes) (%s)\n", + amd_ntb_printf(0, "Mapped BAR%d v:[%p-%p] p:[0x%jx-0x%jx] (0x%jx bytes) (%s)\n", PCI_RID2BAR(bar->pci_resource_id), bar->vbase, - (char *)bar->vbase + bar->size - 1, (void *)bar->pbase, - (void *)(bar->pbase + bar->size - 1), (uintmax_t)bar->size, kind); + (char *)bar->vbase + bar->size - 1, (uintmax_t)bar->pbase, + (uintmax_t)(bar->pbase + bar->size - 1), (uintmax_t)bar->size, kind); } static void diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_intel.c b/sys/dev/ntb/ntb_hw/ntb_hw_intel.c index 2535f7a23290..e0abf927002d 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw_intel.c +++ b/sys/dev/ntb/ntb_hw/ntb_hw_intel.c @@ -925,10 +925,10 @@ print_map_success(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar, { device_printf(ntb->device, - "Mapped BAR%d v:[%p-%p] p:[%p-%p] (0x%jx bytes) (%s)\n", + "Mapped BAR%d v:[%p-%p] p:[0x%jx-0x%jx] (0x%jx bytes) (%s)\n", PCI_RID2BAR(bar->pci_resource_id), bar->vbase, (char *)bar->vbase + bar->size - 1, - (void *)bar->pbase, (void *)(bar->pbase + bar->size - 1), + (uintmax_t)bar->pbase, (uintmax_t)(bar->pbase + bar->size - 1), (uintmax_t)bar->size, kind); } @@ -1012,19 +1012,21 @@ map_memory_window_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar) if (rc == 0) { bar->map_mode = mapmode; device_printf(ntb->device, - "Marked BAR%d v:[%p-%p] p:[%p-%p] as " + "Marked BAR%d v:[%p-%p] p:[0x%jx-0x%jx] as " "%s.\n", PCI_RID2BAR(bar->pci_resource_id), bar->vbase, (char *)bar->vbase + bar->size - 1, - (void *)bar->pbase, (void *)(bar->pbase + bar->size - 1), + (uintmax_t)bar->pbase, + (uintmax_t)(bar->pbase + bar->size - 1), intel_ntb_vm_memattr_to_str(mapmode)); } else device_printf(ntb->device, - "Unable to mark BAR%d v:[%p-%p] p:[%p-%p] as " + "Unable to mark BAR%d v:[%p-%p] p:[0x%jx-0x%jx] as " "%s: %d\n", PCI_RID2BAR(bar->pci_resource_id), bar->vbase, (char *)bar->vbase + bar->size - 1, - (void *)bar->pbase, (void *)(bar->pbase + bar->size - 1), + (uintmax_t)bar->pbase, + (uintmax_t)(bar->pbase + bar->size - 1), intel_ntb_vm_memattr_to_str(mapmode), rc); /* Proceed anyway */ return (0);