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, 9 Aug 2012 07:10:00 +0000
From:	"Kim, Milo" <Milo.Kim@...com>
To:	Axel Lin <axel.lin@...il.com>
CC:	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	"Girdwood, Liam" <lrg@...com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 6/7] regulator: lp872x: set_current_limit should select
 the maximum current in specific range

> -----Original Message-----
> From: Axel Lin [mailto:axel.lin@...il.com]
> Sent: Wednesday, August 08, 2012 9:23 PM
> To: Mark Brown
> Cc: Kim, Milo; Girdwood, Liam; linux-kernel@...r.kernel.org
> Subject: [PATCH 6/7] regulator: lp872x: set_current_limit should select
> the maximum current in specific range
> 
> Signed-off-by: Axel Lin <axel.lin@...il.com>
> ---
>  drivers/regulator/lp872x.c |   18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
> index 212c38e..6199d0f 100644
> --- a/drivers/regulator/lp872x.c
> +++ b/drivers/regulator/lp872x.c
> @@ -374,8 +374,8 @@ static int lp8725_buck_set_current_limit(struct
> regulator_dev *rdev,
>  {
>  	struct lp872x *lp = rdev_get_drvdata(rdev);
>  	enum lp872x_regulator_id buck = rdev_get_id(rdev);
> -	int i, max = ARRAY_SIZE(lp8725_buck_uA);
> -	u8 addr, val;
> +	int i;
> +	u8 addr;
> 
>  	switch (buck) {
>  	case LP8725_ID_BUCK1:
> @@ -388,17 +388,15 @@ static int lp8725_buck_set_current_limit(struct
> regulator_dev *rdev,
>  		return -EINVAL;
>  	}
> 
> -	for (i = 0 ; i < max ; i++)
> +	for (i = ARRAY_SIZE(lp8725_buck_uA) - 1 ; i >= 0; i--) {
>  		if (lp8725_buck_uA[i] >= min_uA &&
>  			lp8725_buck_uA[i] <= max_uA)
> -			break;
> -
> -	if (i == max)
> -		return -EINVAL;
> -
> -	val = i << LP8725_BUCK_CL_S;
> +			return lp872x_update_bits(lp, addr,
> +						  LP8725_BUCK_CL_M,
> +						  i << LP8725_BUCK_CL_S);
> +	}
> 
> -	return lp872x_update_bits(lp, addr, LP8725_BUCK_CL_M, val);
> +	return -EINVAL;
>  }
> 
>  static int lp8725_buck_get_current_limit(struct regulator_dev *rdev)
> --
> 1.7.9.5
> 
> 

It looks a semantic patch rather than operation issue.
Could you let me know why we need this patch in more details ?
Thank you, all the time !

Best Regards,
Milo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ