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]
Message-ID: <20160610210807.GF11948@wotan.suse.de>
Date:	Fri, 10 Jun 2016 23:08:07 +0200
From:	"Luis R. Rodriguez" <mcgrof@...nel.org>
To:	Krzysztof Kozlowski <k.kozlowski@...sung.com>
Cc:	"Luis R. Rodriguez" <mcgrof@...nel.org>,
	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 10:44:19PM +0200, Krzysztof Kozlowski wrote:
> On Fri, Jun 10, 2016 at 10:23:47PM +0200, Luis R. Rodriguez wrote:
> > On Fri, Jun 10, 2016 at 10:16:00PM +0200, Krzysztof Kozlowski wrote:
> > > The dma-attrs in current form were added around 2008 in 74bc7ceebfa1
> > > ("dma: add dma_*map*_attrs() interfaces"), I think. Since that time, for
> > > example, the dma_map_*_attrs() did not change.
> > 
> > So we don't expect this to change either?
> 
> I do not know, I am not aware of planned changes to that.

If this will not change then I think this change is good.

> > > > 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 ?
> > > 
> > > The const is one concern. Complicated (more than expected) usage of dma
> > > attributes by the caller is second. 
> > > 
> > > Switching it to const would also reduce the possibilities of API
> > > extension.
> > 
> > My point was that const can be used for only APIs that we are sure of
> > that need it.
> 
> As of now, dma_attrs should be const everywhere. That would be almost
> the same patchset as current one. If you consider extending the
> dma_attrs to something new and not yet known, then how will
> differentiate between cases when 'const' is needed for sure?

Depends on the use case, but if it known it should always be const
then great.

> I understand your concern. Sticking to current API for that reason might
> be a good defensive API programming... or might be way of keeping this
> function prototype for long...

Since this hasn't changed for years at all I think your change
is reasonable.

  Luis

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ