Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp307105pxv; Wed, 30 Jun 2021 21:38:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWQKPY0UyCVx9QeziVyCkBfqdVaRwl8Ofx4B+RL4M+GIOkrF0nVmn7AuE7TVR6UmzVCq83 X-Received: by 2002:a17:907:968e:: with SMTP id hd14mr6691810ejc.370.1625114315642; Wed, 30 Jun 2021 21:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625114315; cv=none; d=google.com; s=arc-20160816; b=kjJ6T2adW/eM66lRumWdZWtFY4DFqoHsxdI1co1nxQCwNso1z/KuGINiz/PtJxVcxu Jsv9WP+Dp4y1uTFCIZStk6OVp5yKX3u81DtWgQ+mjeiRCskHgTsR5KEj3NbE3k/VKkZ8 8/Jr6HX/u4q+jfZqtwhyExtyAj0Slfnae1cELyX/ElKFu+1IW9ovzymzHHNqbiqn1qOP wd8B1KjVXMPKIV+bYbYOJWlcxkm+8UN6iQ8phpUf3owogeVHI8ts7zgZKLcHOhcPu7p7 Apj/PncMa86MucNSC1XQfBkNfmoxlODSvUHdANhlFneqtlIQqwEeTrT4f3fl/z9zOD+f d6aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=s/7OSvDcbjlIRYSAtG/QvopQHFjskTF3i32K/rwPPyQ=; b=wdS4Wm7PKpvdQrMgb22kg5l04K429NeczB+jAXAq1fDSB+jCs7JHQT1+c/lEEWxKTb x53WzUNTSdid/rAgTzGj1fqxZlv9X/bJ/ZvovpMIfPSvMV5Ku2QBSu4BxWChberlyqGd a5MbscMefj7DJQKXMrGPOfFLWJ4FXZWMwhT4W3dh9yybarufwQPQQbiq9aZskW9p9uwJ BubGOa5SJAn0qdb4JDdp40HPKH2MAGr39bQKXAVrqOVDWohmpTKrnXf5kDq6L1E9Zb6g 2kRaW4oFQP3urNn1ckhT6hkQZ1QHt2JBnIcqS3VDIzdsUlDjzi/Ne40+79z2ffJby30g 6zJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si25822952edj.420.2021.06.30.21.38.11; Wed, 30 Jun 2021 21:38:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232302AbhGAEiG (ORCPT + 99 others); Thu, 1 Jul 2021 00:38:06 -0400 Received: from smtprelay0066.hostedemail.com ([216.40.44.66]:55928 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229577AbhGAEiF (ORCPT ); Thu, 1 Jul 2021 00:38:05 -0400 Received: from omf19.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 5B578181EE40C; Thu, 1 Jul 2021 04:35:35 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA id D603320D770; Thu, 1 Jul 2021 04:35:33 +0000 (UTC) Message-ID: Subject: Re: [RFC 13/19] staging: qlge: rewrite do while loop as for loop in qlge_sem_spinlock From: Joe Perches To: Coiby Xu Cc: Dan Carpenter , linux-staging@lists.linux.dev, netdev@vger.kernel.org, Benjamin Poirier , Shung-Hsi Yu , Manish Chopra , "supporter:QLOGIC QLGE 10Gb ETHERNET DRIVER" , Greg Kroah-Hartman , open list Date: Wed, 30 Jun 2021 21:35:31 -0700 In-Reply-To: <20210630233338.2l34shhrm3bdd4gx@Rk> References: <20210621134902.83587-1-coiby.xu@gmail.com> <20210621134902.83587-14-coiby.xu@gmail.com> <20210622072036.GK1861@kadam> <20210624112245.zgvkcxyu7hzrzc23@Rk> <20210630233338.2l34shhrm3bdd4gx@Rk> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.37 X-Rspamd-Server: rspamout05 X-Rspamd-Queue-Id: D603320D770 X-Stat-Signature: 7rmdc1nrquttg9xgaoqxcsmo73w5qmoc X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19n/GBQXP7gIkMOXhN3RXKOLxsT9DwiqiU= X-HE-Tag: 1625114133-240606 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-07-01 at 07:33 +0800, Coiby Xu wrote: > On Wed, Jun 30, 2021 at 03:58:06AM -0700, Joe Perches wrote: > > On Thu, 2021-06-24 at 19:22 +0800, Coiby Xu wrote: > > > On Tue, Jun 22, 2021 at 10:20:36AM +0300, Dan Carpenter wrote: > > > > On Mon, Jun 21, 2021 at 09:48:56PM +0800, Coiby Xu wrote: > > > > > Since wait_count=30 > 0, the for loop is equivalent to do while > > > > > loop. This commit also replaces 100 with UDELAY_DELAY. > > [] > > > > > diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c > > [] > > I also think using UDELAY_DELAY is silly and essentially misleading > > as it's also used as an argument value for mdelay > > > > $ git grep -w UDELAY_DELAY > > drivers/staging/qlge/qlge.h:#define UDELAY_DELAY 100 > > drivers/staging/qlge/qlge_main.c: udelay(UDELAY_DELAY); > > drivers/staging/qlge/qlge_main.c: udelay(UDELAY_DELAY); > > drivers/staging/qlge/qlge_mpi.c: mdelay(UDELAY_DELAY); > > drivers/staging/qlge/qlge_mpi.c: mdelay(UDELAY_DELAY); > > drivers/staging/qlge/qlge_mpi.c: mdelay(UDELAY_DELAY); /* 100ms */ > > Thanks for spotting this issue! How about "#define MDELAY_DELAY 100" for > mdelay? I think the define is pointless and it'd be more readable to just use 100 in all the cases. IMO: There really aren't enough cases to justify using defines.