From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751901AbdFTInj (ORCPT ); Tue, 20 Jun 2017 04:43:39 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:49182 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751114AbdFTInh (ORCPT ); Tue, 20 Jun 2017 04:43:37 -0400 Date: Tue, 20 Jun 2017 11:42:57 +0300 From: Dan Carpenter To: Vivek Gautam Cc: Kishon Vijay Abraham I , Yendapally Reddy Dhananjaya Reddy , Heiko Stuebner , Florian Fainelli , Axel Lin , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] phy: brcm-sata: fix a timeout test in init Message-ID: <20170620084257.mr2xzz6lqlmp6rlc@mwanda> References: <20170619105251.GA23911@elgon.mountain> <69b479f4-8939-4c11-2c16-2e188e02a625@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69b479f4-8939-4c11-2c16-2e188e02a625@codeaurora.org> User-Agent: NeoMutt/20170113 (1.7.2) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > > 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. regards, dan carpenter