From: Tobias Regnery <tobias.regn...@gmail.com>
Date: Fri, 21 Oct 2016 12:49:44 +0200

> +     txq->tpd = alx->descmem.virt + offset;
> +     txq->tpd_dma = alx->descmem.dma + offset;

If all the crazy casting isn't necessary here...

> +     rxq->rrd = (void *)((u8 *)alx->descmem.virt + offset);
> +     rxq->rrd_dma = alx->descmem.dma + offset;
> +     offset += sizeof(struct alx_rrd) * alx->rx_ringsz;
> +
> +     rxq->rfd = (void *)((u8 *)alx->descmem.virt + offset);
> +     rxq->rfd_dma = alx->descmem.dma + offset;
> +     offset += sizeof(struct alx_rfd) * alx->rx_ringsz;

Then it certainly isn't necessary here either.

Void pointer arithmatic is very clearly defined as operating on byte
quantities, so the cast is not necessary for the arithmetic nor the
final pointer type.

Reply via email to