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] [day] [month] [year] [list]
Message-ID: <CAFRkauBveVDps1Fo8kwjPz0VT_wQ_5FU_QxVMP6eWMuFPZz=4g@mail.gmail.com>
Date:	Tue, 24 Feb 2015 21:53:23 +0800
From:	Axel Lin <axel.lin@...ics.com>
To:	Kishon Vijay Abraham I <kishon@...com>
Cc:	Gabriel FERNANDEZ <gabriel.fernandez@...com>,
	Lee Jones <lee.jones@...aro.org>,
	Alexandre Torgue <alexandre.torgue@...com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] phy: miphy28lp: Avoid calling of_get_child_count()
 multiple times

2015-02-24 21:47 GMT+08:00 Kishon Vijay Abraham I <kishon@...com>:
> Hi,
>
> On Tuesday 24 February 2015 05:22 PM, Axel Lin wrote:
>>
>> Currently, of_get_child_count() is called in each iteration of the for
>> loop in
>> miphy28lp_xlate(). This patch stores the return value of
>> of_get_child_count()
>> in miphy_dev->nphys and call of_get_child_count() once in
>> miphy28lp_probe().
>>
>> Signed-off-by: Axel Lin <axel.lin@...ics.com>
>> ---
>>   drivers/phy/phy-miphy28lp.c | 11 ++++++-----
>>   1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c
>> index 9b2848e..d444932 100644
>> --- a/drivers/phy/phy-miphy28lp.c
>> +++ b/drivers/phy/phy-miphy28lp.c
>> @@ -228,6 +228,7 @@ struct miphy28lp_dev {
>>         struct regmap *regmap;
>>         struct mutex miphy_mutex;
>>         struct miphy28lp_phy **phys;
>> +       int nphys;
>
>
> it can just be a local member to miphy28lp_xlate() since it's not used
> anywhere else.

It's used in both miphy28lp_probe() and miphy28lp_xlate().
miphy_dev->phys replaces the chancount local variable as well.

Regards,
Axel
--
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