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: <51D0C6DF.1000805@samsung.com>
Date:	Mon, 01 Jul 2013 09:01:35 +0900
From:	jonghwa3.lee@...sung.com
To:	Axel Lin <axel.lin@...ics.com>
Cc:	Mark Brown <broonie@...nel.org>,
	Jonghwa Lee <jonghwa3.lee@...sung.com>,
	Myungjoo Ham <myungjoo.ham@...sung.com>,
	Liam Girdwood <lgirdwood@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regulator: max77693: Remove NULL test for
 rmatch[i].init_data

On 2013년 06월 30일 01:33, Axel Lin wrote:

> The implementation in of_regulator_match() already ensures match->init_data is
> not NULL for all matched cases if the return value of of_regulator_match() > 0.
> 
> Thus remove NULL test for rmatch[i].init_data.
> 
> This patch also fixes the condition for loop iteration.
> The for loop should iterate "matched" times rather than ARRAY_SIZE(regulators)
> because we only allocate "matched" number of entries for rdata.
> Though in most cases, "matched" == ARRAY_SIZE(regulators).
> 
> Signed-off-by: Axel Lin <axel.lin@...ics.com>
> ---
>  drivers/regulator/max77693.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/regulator/max77693.c b/drivers/regulator/max77693.c
> index d45a4dd..ce4b96c 100644
> --- a/drivers/regulator/max77693.c
> +++ b/drivers/regulator/max77693.c
> @@ -190,9 +190,7 @@ static int max77693_pmic_dt_parse_rdata(struct device *dev,
>  
>  	tmp = *rdata;
>  
> -	for (i = 0; i < ARRAY_SIZE(regulators); i++) {
> -		if (!rmatch[i].init_data)
> -			continue;
> +	for (i = 0; i < matched; i++) {
>  		tmp->initdata = rmatch[i].init_data;
>  		tmp->of_node = rmatch[i].of_node;
>  		tmp->id = regulators[i].id;


Looks good to me,

Acked-by : Jonghwa Lee <jonghwa3.lee@...sung.com>


Thanks,
Jonghwa
--
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