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: <4DC02DD4.9000505@codeaurora.org>
Date:	Tue, 03 May 2011 09:31:16 -0700
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	Jorge Eduardo Candelaria <jedu@...mlogic.co.uk>
CC:	linux-kernel@...r.kernel.org, broonie@...nsource.wolfsonmicro.com,
	sameo@...ux.intel.com, lrg@...com,
	Graeme Gregory <gg@...mlogic.co.uk>, grant.likely@...retlab.ca
Subject: Re: [PATCH 2/5] regulator: tps65911: Add new chip version

On 05/03/2011 09:18 AM, Jorge Eduardo Candelaria wrote:
> @@ -419,17 +541,21 @@ static int tps65910_get_voltage_dcdc(struct regulator_dev *dev)
>  		mult=1;
>  
>  	if (sr) {
> -		/* Valid range is 3-75 so normalise */
> -		if (srvsel < 3) srvsel = 3;
> -		if (srvsel > 75) srvsel = 75;
> +		/* normalise to valid range */
> +		if (srvsel < 3)
> +			srvsel = 3;
> +		if (srvsel > vselmax)
> +			srvsel = vselmax;
>  		srvsel -= 3;
>  
>  		voltage = (srvsel * VDD1_2_OFFSET + VDD1_2_MIN_VOLT) * 100;
>  	} else {
>  
> -		/* Valid range is 3-75 so normalise */
> -		if (opvsel < 3) opvsel = 3;
> -		if (opvsel > 75) opvsel = 75;
> +		/* normalise to valid range*/
> +		if (opvsel < 3)
> +			opvsel = 3;
> +		if (opvsel > vselmax)
> +			opvsel = vselmax;

Can we use clamp() instead?

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ