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:   Thu, 25 Apr 2019 19:37:36 +0100
From:   Mark Brown <broonie@...nel.org>
To:     Jorge Ramirez <jorge.ramirez-ortiz@...aro.org>
Cc:     lgirdwood@...il.com, robh+dt@...nel.org, mark.rutland@....com,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
        bjorn.andersson@...aro.org, vinod.koul@...aro.org,
        niklas.cassel@...aro.org, khasim.mohammed@...aro.org,
        linux-arm-kernel@...ts.infradead.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH 2/3] drivers: regulator: qcom: add PMS405 SPMI regulator

On Fri, Apr 19, 2019 at 07:29:48PM +0200, Jorge Ramirez wrote:
> On 2/4/19 10:03, Mark Brown wrote:

> >> +	/* we know we only have one range for this type */
> >> +	if (vreg->logical_type == SPMI_REGULATOR_LOGICAL_TYPE_HFS430)
> >> +		return range;

> > Rather than have special casing for the logical type in here it seems
> > better to just provide a specific op for this logical type, you could
> > always make _find_range() call into that one if you really want code
> > reuse here.  You already have separate ops for this regulator type
> > anyway.

> sorry I dont quite understand your point.

If you need to skip the majority of the contents of the function for
some regulators just define a separate function for those regulators and
give them different ops structures rather than using the same ops
structure and handling it in the functions.

> But also I am not sure I see the benefits with respect to the proposed
> change...

The benefit is that the selection of which operations to use is done in
only one place (the selection of the ops structure) rather than in
multiple places (the selection of the ops structure and the contents of
the operations).

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