Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp124769pxv; Thu, 24 Jun 2021 04:27:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQ89UkY3sjL8Ah4eGAztyrY5Fd3egaS1cTcc4FEw9j6DJWiIosboPuQxM/Urc1c9i7xOUl X-Received: by 2002:a17:907:6289:: with SMTP id nd9mr4780678ejc.384.1624534028306; Thu, 24 Jun 2021 04:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624534028; cv=none; d=google.com; s=arc-20160816; b=bBCpYPPL2PAZwHNUAQoRQsjlLv2DMk1ooKvQuaiaahXk4n7cezQHbPaM2eUaHx8/wx UTpcESxqtvcqllfynnrqeJRVW7JZ6j/LjnUnBxSCG40SHw69TNv2Y/aBPEKBlQoCARME IxFPAOvISWRLDicE0gGlZS4ClwCeWo603Yl86YPUPjSJ1F8FBsvCytqrtXEn7ruRfk93 6dO46FscMBnhUy/e9AF6yPHlZv4weT9mPpLACvHLvdlJdbtvUtW8dXAneuVr/b4peLMZ Ww8PMmsWblpXQHm1pTU5N/r0334kBTQSOzLZYsViqQqXcKlusAvf8aqWbXIzOcbqRs2t MfAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=AvRzk6yM4BX1NO5XMxEtdArbNT4paDVtHU1ZzBJEtC0=; b=e1hPf+VxBYnzz+YGa4NoTsFs2+LdfsCdHBvDi+05M5Fh7M92JXbpniLSo28B2n+DXK nKQmgEBA9kON3FTpIJSPZSrFb3zr7+Gzzox+5Evvlyt8dKZoy3U9ukMDukNTvUcZ4qAd wOc/v7vpzq3t7KPM+coPEospeYGxfxZ1bWt2NEekwNVb9MEtWO+B4se3GpsZb4qDkC3x 2EpaQhZU9hqWmoR5z46ttvTsXv12QBY0nHb7N2lAT3Qu5NQTUzEq46GskGWw8Rh44X/U 0ivIPFprKzTmtH7kt6M7NtuAo21tltZMBPQtqjLEry6SuVwAhfGBcrHIjIpRiPa1yTpE TqrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZucTXTtc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id en20si2631208ejc.13.2021.06.24.04.26.45; Thu, 24 Jun 2021 04:27:08 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZucTXTtc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232427AbhFXL13 (ORCPT + 99 others); Thu, 24 Jun 2021 07:27:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232274AbhFXL12 (ORCPT ); Thu, 24 Jun 2021 07:27:28 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F90DC061574; Thu, 24 Jun 2021 04:25:10 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id b5-20020a17090a9905b029016fc06f6c5bso3262976pjp.5; Thu, 24 Jun 2021 04:25:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AvRzk6yM4BX1NO5XMxEtdArbNT4paDVtHU1ZzBJEtC0=; b=ZucTXTtcuQRo5/mqSnG5JDGiaO/6AySlJbTTkNZd2961RYCpQdnDAV5hu58lP286uN rbA/vwA0GuvmfyP4ZcD8GOwqUc87JKfkdwxFOkH0JeyyegY96WQfxaq402f2n+9eCVOg SUSojswAsqdRzDtBnt2j+6HaEZc7FGS9tSHMPapzxbLrfgMSLxU0UluJ57wTPbwjov/a 21kmEUPlVqZTtNCGZbJeySWFfsKE9gD/fZuOZ87xAuvC2a5y/+8RcMu3u9fbaV1V4ZGK 3iNNtyqFv7TpU7Wi+g7Wo0lU1tN96jiotb375rgyKj8H1kEdkHMdZpFrc4PEUle6xTNi fVDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AvRzk6yM4BX1NO5XMxEtdArbNT4paDVtHU1ZzBJEtC0=; b=cVnIJ73GJflDJM8WrOVuUrMiugVYSvMY6LMHO6K6tdAhvLwB6Ka8KythWsjlBq7TQF z9Bp0vste/BOd1y3qVDi5idjCDDfzfJZW2Wkbc2tgVwmX0fXB1r51w5oqR4rAL3smgIf uJBoZju3fy+NvaTrRCVoEUODPmWXoD+pcA9ZlBxDQml5L2jdvbZpTYHRayDHPjY8cK4R Qses62xZsoPWsDhfiHMUp6v3Rqq1s910/x6Jc8QfJ/1M5fWFqM/LT9Oqe47H7GsSWZP2 pp82P1VLQIq6IPBYWTGWckNp5PENYxGtSErdDSWrVapySNJMy40XQTxMlS0Ec+uZjUKG ageg== X-Gm-Message-State: AOAM532annqIeD59AoUIzRXuseSn/Mkc/C60hjrI4zjngJnLhSNs6RgR TMiJRmaVODUBNuq539hdHxA= X-Received: by 2002:a17:903:31d3:b029:ee:bccd:e686 with SMTP id v19-20020a17090331d3b02900eebccde686mr3907255ple.1.1624533909744; Thu, 24 Jun 2021 04:25:09 -0700 (PDT) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id w11sm2227719pgp.60.2021.06.24.04.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 04:25:08 -0700 (PDT) From: Coiby Xu X-Google-Original-From: Coiby Xu Date: Thu, 24 Jun 2021 19:22:45 +0800 To: Dan Carpenter Cc: 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 Subject: Re: [RFC 13/19] staging: qlge: rewrite do while loop as for loop in qlge_sem_spinlock Message-ID: <20210624112245.zgvkcxyu7hzrzc23@Rk> References: <20210621134902.83587-1-coiby.xu@gmail.com> <20210621134902.83587-14-coiby.xu@gmail.com> <20210622072036.GK1861@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210622072036.GK1861@kadam> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >> >> Signed-off-by: Coiby Xu >> --- >> drivers/staging/qlge/qlge_main.c | 7 ++++--- >> 1 file changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c >> index c5e161595b1f..2d2405be38f5 100644 >> --- a/drivers/staging/qlge/qlge_main.c >> +++ b/drivers/staging/qlge/qlge_main.c >> @@ -140,12 +140,13 @@ static int qlge_sem_trylock(struct qlge_adapter *qdev, u32 sem_mask) >> int qlge_sem_spinlock(struct qlge_adapter *qdev, u32 sem_mask) >> { >> unsigned int wait_count = 30; >> + int count; >> >> - do { >> + for (count = 0; count < wait_count; count++) { >> if (!qlge_sem_trylock(qdev, sem_mask)) >> return 0; >> - udelay(100); >> - } while (--wait_count); >> + udelay(UDELAY_DELAY); > >This is an interesting way to silence the checkpatch udelay warning. ;) I didn't know this could silence the warning :) > >regards, >dan carpenter > -- Best regards, Coiby