git: b4269beda1b1 - stable/15 - iwx: Fix 32-bit compilation
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 05 Mar 2026 22:06:15 UTC
The branch stable/15 has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=b4269beda1b1a64fab5c9a582a35b0bb2c688360
commit b4269beda1b1a64fab5c9a582a35b0bb2c688360
Author: Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2026-03-05 12:31:51 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2026-03-05 22:05:42 +0000
iwx: Fix 32-bit compilation
- Avoid shifts wider than integer types, by wrapping the corresponding
checks into '#if __SIZEOF_SIZE_T__ > 32' blocks. 'bus_addr_t'
currently has the same width as 'size_t' on all architectures (and
this is not going to change for 32-bit architectures).
- Use appropriate printf(3) format for 'wk_keytsc'.
Reviewed by: adrian
MFC after: 1 minute
MFC to: stable/15
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55667
(cherry picked from commit 35da55c28dbb56dd7056b7863efc5b547950d885)
---
sys/dev/iwx/if_iwx.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/sys/dev/iwx/if_iwx.c b/sys/dev/iwx/if_iwx.c
index 1fe531d69933..6d12de0753c0 100644
--- a/sys/dev/iwx/if_iwx.c
+++ b/sys/dev/iwx/if_iwx.c
@@ -155,6 +155,7 @@
#include <sys/epoch.h>
#include <sys/kdb.h>
+#include <machine/_inttypes.h>
#include <machine/bus.h>
#include <machine/endian.h>
#include <machine/resource.h>
@@ -5775,15 +5776,21 @@ iwx_tx(struct iwx_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
desc->tbs[0].tb_len = htole16(IWX_FIRST_TB_SIZE);
paddr = htole64(data->cmd_paddr);
memcpy(&desc->tbs[0].addr, &paddr, sizeof(paddr));
- if (data->cmd_paddr >> 32 != (data->cmd_paddr + le32toh(desc->tbs[0].tb_len)) >> 32)
+#if __SIZEOF_SIZE_T__ > 32
+ if (data->cmd_paddr >> 32 != (data->cmd_paddr +
+ le32toh(desc->tbs[0].tb_len)) >> 32)
DPRINTF(("%s: TB0 crosses 32bit boundary\n", __func__));
+#endif
desc->tbs[1].tb_len = htole16(sizeof(struct iwx_cmd_header) +
txcmd_size + hdrlen + pad - IWX_FIRST_TB_SIZE);
paddr = htole64(data->cmd_paddr + IWX_FIRST_TB_SIZE);
memcpy(&desc->tbs[1].addr, &paddr, sizeof(paddr));
- if (data->cmd_paddr >> 32 != (data->cmd_paddr + le32toh(desc->tbs[1].tb_len)) >> 32)
+#if __SIZEOF_SIZE_T__ > 32
+ if (data->cmd_paddr >> 32 != (data->cmd_paddr +
+ le32toh(desc->tbs[1].tb_len)) >> 32)
DPRINTF(("%s: TB1 crosses 32bit boundary\n", __func__));
+#endif
/* Other DMA segments are for data payload. */
for (i = 0; i < nsegs; i++) {
@@ -5791,8 +5798,12 @@ iwx_tx(struct iwx_softc *sc, struct mbuf *m, struct ieee80211_node *ni)
desc->tbs[i + 2].tb_len = htole16(seg->ds_len);
paddr = htole64(seg->ds_addr);
memcpy(&desc->tbs[i + 2].addr, &paddr, sizeof(paddr));
- if (data->cmd_paddr >> 32 != (data->cmd_paddr + le32toh(desc->tbs[i + 2].tb_len)) >> 32)
- DPRINTF(("%s: TB%d crosses 32bit boundary\n", __func__, i + 2));
+#if __SIZEOF_SIZE_T__ > 32
+ if (data->cmd_paddr >> 32 != (data->cmd_paddr +
+ le32toh(desc->tbs[i + 2].tb_len)) >> 32)
+ DPRINTF(("%s: TB%d crosses 32bit boundary\n", __func__,
+ i + 2));
+#endif
}
bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_PREWRITE);
@@ -10987,7 +10998,7 @@ iwx_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k)
cmd.common.sta_id = IWX_STATION_ID;
cmd.transmit_seq_cnt = htole64(k->wk_keytsc);
- DPRINTF(("%s: k->wk_keytsc=%lu\n", __func__, k->wk_keytsc));
+ DPRINTF(("%s: k->wk_keytsc=%" PRIu64 "\n", __func__, k->wk_keytsc));
status = IWX_ADD_STA_SUCCESS;
err = iwx_send_cmd_pdu_status(sc, IWX_ADD_STA_KEY, sizeof(cmd), &cmd,