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]
Date:	Fri, 10 Jun 2016 18:47:46 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	Boris Brezillon <boris.brezillon@...e-electrons.com>
Cc:	linux-pwm@...r.kernel.org, Mark Brown <broonie@...nel.org>,
	Liam Girdwood <lgirdwood@...il.com>,
	Heiko Stuebner <heiko@...ech.de>,
	linux-rockchip@...ts.infradead.org,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>, devicetree@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Milo Kim <milo.kim@...com>,
	Doug Anderson <dianders@...gle.com>,
	Caesar Wang <wxt@...k-chips.com>,
	Stephen Barber <smbarber@...omium.org>,
	Brian Norris <briannorris@...omium.org>,
	Ajit Pal Singh <ajitpal.singh@...com>,
	Srinivas Kandagatla <srinivas.kandagatla@...il.com>,
	Maxime Coquelin <maxime.coquelin@...com>,
	Patrice Chotard <patrice.chotard@...com>, kernel@...inux.com,
	Laxman Dewangan <ldewangan@...dia.com>
Subject: Re: [PATCH v2 01/13] pwm: Add new helpers to create/manipulate PWM
 states

On Fri, Jun 10, 2016 at 06:29:42PM +0200, Boris Brezillon wrote:
> On Fri, 10 Jun 2016 17:21:09 +0200, Thierry Reding <thierry.reding@...il.com> wrote:
> > On Wed, Jun 08, 2016 at 06:34:36PM +0200, Boris Brezillon wrote:
[...]
> > > + * according to your need before calling pwm_apply_state().  
> > 
> > Maybe mention that the ->duty_cycle field is explicitly zeroed. Then
> > again, do we really need it? If users are going to overwrite it anyway,
> > do we even need to bother? I suppose it makes some sense because the
> > current duty cycle is stale when the ->period gets set to the value from
> > args. I think the documentation should mention this in some way.
> 
> Yes, if we keep the current duty_cycle it can exceed the period value.
> I'm fine dropping the ->duty_cycle = 0 assignment and documenting the
> behavior.

Actually what I was trying to suggest is that we keep the code as-is but
document the behaviour (and rationale behind it).

I think it's fine to zero out the value precisely because it could
become invalid after the function (and there's no other reasonable value
to set it to). Just wanted to make sure it's all properly documented.

Thierry

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ