From 5494dcfa1cd8f85b145d10e9372fccf137d1bcd2 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 17 Jun 2018 19:24:40 +0000 Subject: [PATCH] Fix build of ndis 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 use an intermediate cast to uintptr_t to suppress it. In this case, the I/O port range is effectively limited to the range of 0..65535. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15746 --- sys/compat/ndis/subr_ndis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index e1ba8cc12cd6..914c85887e47 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -1287,7 +1287,7 @@ NdisMRegisterIoPortRange(offset, adapter, port, numports) if (rman_get_size(sc->ndis_res_io) < numports) return (NDIS_STATUS_INVALID_LENGTH); - *offset = (void *)rman_get_start(sc->ndis_res_io); + *offset = (void *)(uintptr_t)rman_get_start(sc->ndis_res_io); return (NDIS_STATUS_SUCCESS); }