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: <20181210154125.GE6307@sirena.org.uk>
Date:   Mon, 10 Dec 2018 15:41:25 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Liam Girdwood <lgirdwood@...il.com>, linux-kernel@...r.kernel.org,
        Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: Re: [PATCH 2/2] regulator: provide
 regulator_set_voltage_sel_regmap_step() helper

On Mon, Dec 10, 2018 at 04:10:24PM +0100, Bartosz Golaszewski wrote:

> On some devices we need to manually ramp the regulators to desired
> voltage one step at a time. This patch adds a helper routine for
> regmap users that checks if the regulator is enabled and, if so,

My first question would be why do this at the regmap helper level, why
not do this at the core level by stepping through selectors?  I'd also
expect to be programming the step size here, while some regulators
aren't able to regulate well over larger step changes I'd expect that
they wouldn't need to step through every single possible voltage value,
that's potentially extremely slow.

> +	asc = diff > 0 ? false : true;
> +	end = asc ? sel + 1 : sel - 1;
> +	asc ? curr++ : curr--;

Please just write normal conditional statements so the code is more
readable and hence maintainable.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ