From 48f00bafa17458f3f5d63ab94e2b9f2c62a95121 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 11 Jun 2018 10:08:22 +0000 Subject: [PATCH] Fix build of bxe with base gcc on i386 Casting from rman_res_t to a pointer results in "cast to pointer from integer of different size" warnings with base gcc on i386, so print these without casting. The kva field of struct bxe_bar is of type vm_offset_t, which can be 32 or 64 bit, so cast it to uintmax_t before printing. Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15733 --- sys/dev/bxe/bxe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index 3174d871088c..2afd859d6127 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -12849,12 +12849,12 @@ bxe_allocate_bars(struct bxe_softc *sc) sc->bar[i].handle = rman_get_bushandle(sc->bar[i].resource); sc->bar[i].kva = (vm_offset_t)rman_get_virtual(sc->bar[i].resource); - BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %p-%p (%jd) -> %p\n", + BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %#jx-%#jx (%jd) -> %#jx\n", i, PCIR_BAR(i), - (void *)rman_get_start(sc->bar[i].resource), - (void *)rman_get_end(sc->bar[i].resource), + rman_get_start(sc->bar[i].resource), + rman_get_end(sc->bar[i].resource), rman_get_size(sc->bar[i].resource), - (void *)sc->bar[i].kva); + (uintmax_t)sc->bar[i].kva); } return (0);