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: <c13b054d-2713-8303-c599-96d315521736@codeaurora.org>
Date:   Tue, 20 Jun 2017 14:26:15 +0530
From:   Vivek Gautam <vivek.gautam@...eaurora.org>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Kishon Vijay Abraham I <kishon@...com>,
        Yendapally Reddy Dhananjaya Reddy 
        <yendapally.reddy@...adcom.com>, Heiko Stuebner <heiko@...ech.de>,
        Florian Fainelli <f.fainelli@...il.com>,
        Axel Lin <axel.lin@...ics.com>, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] phy: brcm-sata: fix a timeout test in init



On 06/20/2017 02:12 PM, Dan Carpenter wrote:
> On Tue, Jun 20, 2017 at 01:56:35PM +0530, Vivek Gautam wrote:
>>
>> On 06/19/2017 04:26 PM, Dan Carpenter wrote:
>>> We want to timeout with try set to zero so this should be a pre-op
>>> instead of post-op.
>>>
>>> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
>>>
>>> diff --git a/drivers/phy/broadcom/phy-brcm-sata.c b/drivers/phy/broadcom/phy-brcm-sata.c
>>> index ccbc3d994998..48fb016ce689 100644
>>> --- a/drivers/phy/broadcom/phy-brcm-sata.c
>>> +++ b/drivers/phy/broadcom/phy-brcm-sata.c
>>> @@ -329,7 +329,7 @@ static int brcm_nsp_sata_init(struct brcm_sata_port *port)
>>>    	/* Wait for pll_seq_done bit */
>>>    	try = 50;
>>> -	while (try--) {
>>> +	while (--try) {
>> Do we want to try reading the status 50 times? If yes, won't your change
>> break that? It will rather run the loop 49 times.
>>
> Yeah.  I know.  I'm pretty sure that 50 is a rough number, and not an
> exact thing.

Right, I agree that this must be rough count.
nice catch btw.

Best regards
Vivek

>
> regards,
> dan carpenter
>

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ