lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20161023.115012.1557996279582284252.davem@davemloft.net>
Date:   Sun, 23 Oct 2016 11:50:12 -0400 (EDT)
From:   David Miller <davem@...emloft.net>
To:     tobias.regnery@...il.com
Cc:     jcliburn@...il.com, chris.snook@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 1/9] alx: refactor descriptor allocation

From: Tobias Regnery <tobias.regnery@...il.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ