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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 10 Jun 2016 16:49:47 +0200
From:	"Luis R. Rodriguez" <mcgrof@...nel.org>
To:	Krzysztof Kozlowski <k.kozlowski@...sung.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>, hch@...radead.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
	Jonathan Corbet <corbet@....net>,
	Russell King <rmk+kernel@....linux.org.uk>,
	Robin Murphy <robin.murphy@....com>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Doug Anderson <armlinux@...isordat.com>,
	Will Deacon <will.deacon@....com>,
	Joerg Roedel <jroedel@...e.de>,
	Christian Borntraeger <borntraeger@...ibm.com>,
	Zhen Lei <thunder.leizhen@...wei.com>,
	"Michael S. Tsirkin" <mst@...hat.com>,
	Andy Lutomirski <luto@...nel.org>, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 01/44] dma-mapping: Use unsigned long for dma_attrs

On Fri, Jun 10, 2016 at 12:11:18PM +0200, Krzysztof Kozlowski wrote:
> The dma-mapping core and the implementations do not change the
> DMA attributes passed by pointer.  Thus the pointer can point to const
> data.  However the attributes do not have to be a bitfield. Instead
> unsigned long will do fine:
> 
> 1. This is just simpler.  Both in terms of reading the code and setting
>    attributes.  Instead of initializing local attributes on the stack
>    and passing pointer to it to dma_set_attr(), just set the bits.
> 
> 2. It brings safeness and checking for const correctness because the
>    attributes are passed by value.

Do we not expect the number of argument to grow ? This "cleanup" would
do away with such possibilities, and then require adding the API later,
and this requiring a full set of collateral evolutions again when this
is needed. What was the original motivation for using this instead of
the approach you are suggesting ?

If the concern is the const data, why not require const struct dma_attr
for the APIs that we know can and should use const ?

  Luis

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ