git: 287a91f2cec6 - main - mpr(4)/mps(4): Fix build on 32-bit platforms

From: Li-Wen Hsu <lwhsu_at_FreeBSD.org>
Date: Wed, 18 Nov 2026 11:54:23 UTC
The branch main has been updated by lwhsu:

URL: https://cgit.FreeBSD.org/src/commit/?id=287a91f2cec68631650a5f43f2cc20e7be49e341

commit 287a91f2cec68631650a5f43f2cc20e7be49e341
Author:     Li-Wen Hsu <lwhsu@FreeBSD.org>
AuthorDate: 2026-11-18 11:52:45 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2026-11-18 11:52:45 +0000

    mpr(4)/mps(4): Fix build on 32-bit platforms
    
    bus_addr_t is 32-bit on armv7, so >> 32 triggers -Wshift-count-overflow.
    Widen it to uint64_t before shifting, as the other high-address writes
    in the same files.
    
    Fixes:          866760ff8338 ("mps(4): add support for hostboot")
    Sponsored by:   The FreeBSD Foundation
---
 sys/dev/mpr/mpr.c | 2 +-
 sys/dev/mps/mps.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c
index 45669d1eba42..0c1f8d56f822 100644
--- a/sys/dev/mpr/mpr.c
+++ b/sys/dev/mpr/mpr.c
@@ -1058,7 +1058,7 @@ mpr_hostboot(struct mpr_softc *sc, uint8_t *fw_image, uint32_t fw_len)
 	mpr_regwrite(sc, MPI2_HCB_ADDRESS_LOW_OFFSET,
 	    (uint32_t)(hcb_busaddr & 0xffffffff));
 	mpr_regwrite(sc, MPI2_HCB_ADDRESS_HIGH_OFFSET,
-	    (uint32_t)(hcb_busaddr >> 32));
+	    (uint32_t)((uint64_t)hcb_busaddr >> 32));
 
 	/* Select HCDW as the boot device, then release the IOC from reset. */
 	mpr_dprint(sc, MPR_INIT, "hostboot: booting IOC from host memory\n");
diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c
index f76160e56932..50c1c5752b6d 100644
--- a/sys/dev/mps/mps.c
+++ b/sys/dev/mps/mps.c
@@ -1028,7 +1028,7 @@ mps_hostboot(struct mps_softc *sc, uint8_t *fw_image, uint32_t fw_len)
 	mps_regwrite(sc, MPI2_HCB_ADDRESS_LOW_OFFSET,
 	    (uint32_t)(hcb_busaddr & 0xffffffff));
 	mps_regwrite(sc, MPI2_HCB_ADDRESS_HIGH_OFFSET,
-	    (uint32_t)(hcb_busaddr >> 32));
+	    (uint32_t)((uint64_t)hcb_busaddr >> 32));
 
 	/* Select HCDW as the boot device, then release the IOC from reset. */
 	mps_dprint(sc, MPS_INIT, "hostboot: booting IOC from host memory\n");