From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754470AbbETXSC (ORCPT ); Wed, 20 May 2015 19:18:02 -0400 Received: from mx0a-0016ce01.pphosted.com ([67.231.148.157]:28230 "EHLO mx0a-0016ce01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753907AbbETXSA (ORCPT ); Wed, 20 May 2015 19:18:00 -0400 From: Harish Patil To: Joe Perches , Sudarsana Kalluru CC: Dept-GE Linux NIC Dev , "Dept-Eng Linux Driver" , netdev , linux-kernel Subject: Re: [PATCH] qlge: Move jiffies_to_usecs immediately before loop Thread-Topic: [PATCH] qlge: Move jiffies_to_usecs immediately before loop Thread-Index: AQHQkre4+eASCu3Yfke5kUlUA5+9U52FgPCA Date: Wed, 20 May 2015 23:17:51 +0000 Message-ID: References: <1432097092.2870.266.camel@perches.com> In-Reply-To: <1432097092.2870.266.camel@perches.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.4.10] disclaimer: bypass Content-Type: text/plain; charset="utf-8" Content-ID: <981CE9A455388E489438224F24105C9D@qlogic.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=7807 signatures=670586 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1505200304 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t4KNI5KQ015387 > >30 usecs (or really, 1 jiffy) can go by pretty fast. > >Move the set of the timeout immediately before the loop. > >Remove the unnecessary max(1ul, usecs_to_jiffies(30)) as >usecs_to_jiffies with a non-zero constant is guaranteed >to be non-zero. > >Signed-off-by: Joe Perches >--- > drivers/net/ethernet/qlogic/qlge/qlge_main.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > >diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c >b/drivers/net/ethernet/qlogic/qlge/qlge_main.c >index 25800a1..02b7115 100644 >--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c >+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c >@@ -3871,9 +3871,6 @@ static int ql_adapter_reset(struct ql_adapter *qdev) > return status; > } > >- end_jiffies = jiffies + >- max((unsigned long)1, usecs_to_jiffies(30)); >- > /* Check if bit is set then skip the mailbox command and > * clear the bit, else we are in normal reset process. > */ >@@ -3888,6 +3885,7 @@ static int ql_adapter_reset(struct ql_adapter *qdev) > > ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); > >+ end_jiffies = jiffies + usecs_to_jiffies(30); > do { > value = ql_read32(qdev, RST_FO); > if ((value & RST_FO_FR) == 0) > > > Acked-by: Harish Patil Thanks, Harish {.n++%ݶw{.n+{G{ayʇڙ,jfhz_(階ݢj"mG?&~iOzv^m ?I