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
This commit is contained in:
Mark Johnston 2020-07-16 14:21:55 +00:00
parent 34a8e7368f
commit 39523b486b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363251

View File

@ -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",