From 39523b486b5721a7fa4270a20f086b5e1254e47a Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 16 Jul 2020 14:21:55 +0000 Subject: [PATCH] safexcel(4): Silence an integer truncation warning. In practice overflow is not possible, but we might as well use the right type for DMA ring sizes. CID: 1430468 MFC after: 1 week --- sys/dev/safexcel/safexcel.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index e59a82e01195..2f7f2c04cc8e 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -901,7 +901,8 @@ static int safexcel_dma_init(struct safexcel_softc *sc) { struct safexcel_ring *ring; - int error, i, size; + bus_size_t size; + int error, i; for (i = 0; i < sc->sc_config.rings; i++) { ring = &sc->sc_ring[i]; @@ -937,8 +938,9 @@ safexcel_dma_init(struct safexcel_softc *sc) (struct safexcel_cmd_descr *)ring->cdr.dma.vaddr; /* Allocate additional CDR token memory. */ - error = safexcel_dma_alloc_mem(sc, &ring->dma_atok, - sc->sc_config.atok_offset * SAFEXCEL_RING_SIZE); + size = (bus_size_t)sc->sc_config.atok_offset * + SAFEXCEL_RING_SIZE; + error = safexcel_dma_alloc_mem(sc, &ring->dma_atok, size); if (error != 0) { device_printf(sc->sc_dev, "failed to allocate atoken DMA memory, error %d\n",