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:
parent
34a8e7368f
commit
39523b486b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363251
@ -901,7 +901,8 @@ static int
|
|||||||
safexcel_dma_init(struct safexcel_softc *sc)
|
safexcel_dma_init(struct safexcel_softc *sc)
|
||||||
{
|
{
|
||||||
struct safexcel_ring *ring;
|
struct safexcel_ring *ring;
|
||||||
int error, i, size;
|
bus_size_t size;
|
||||||
|
int error, i;
|
||||||
|
|
||||||
for (i = 0; i < sc->sc_config.rings; i++) {
|
for (i = 0; i < sc->sc_config.rings; i++) {
|
||||||
ring = &sc->sc_ring[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;
|
(struct safexcel_cmd_descr *)ring->cdr.dma.vaddr;
|
||||||
|
|
||||||
/* Allocate additional CDR token memory. */
|
/* Allocate additional CDR token memory. */
|
||||||
error = safexcel_dma_alloc_mem(sc, &ring->dma_atok,
|
size = (bus_size_t)sc->sc_config.atok_offset *
|
||||||
sc->sc_config.atok_offset * SAFEXCEL_RING_SIZE);
|
SAFEXCEL_RING_SIZE;
|
||||||
|
error = safexcel_dma_alloc_mem(sc, &ring->dma_atok, size);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
device_printf(sc->sc_dev,
|
device_printf(sc->sc_dev,
|
||||||
"failed to allocate atoken DMA memory, error %d\n",
|
"failed to allocate atoken DMA memory, error %d\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user