Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp533611iol; Thu, 9 Jun 2022 08:34:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkoO2pCcX0m57nf3M4qkR22tb67XcOvcpLguDg7N9ml9t16ZvcevstTlsihnlU9UF4jX4z X-Received: by 2002:a17:90a:b002:b0:1ea:4140:edd2 with SMTP id x2-20020a17090ab00200b001ea4140edd2mr3920130pjq.21.1654788853469; Thu, 09 Jun 2022 08:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654788853; cv=none; d=google.com; s=arc-20160816; b=IStPiXYvb8YXvf6XN5m+1Bp/R9pthB7YR8vVRbHRyrHK9OJcU4bZCBvIwuQ6xgATsT mmHJSMrNF8kTd2OIKoj44Gfl3JapQREAt0k2uOowClhvRdlb9EId18EC+O70phXySelc 7XV60dWfhqTey9/raFG0LM5opjV/dJtr+H7UL52B6HtIQfdKT8wH0J0QyZfitBUUw3PU 9FVolp+6/levzxBe3omw80zZhQi4+VI4gF2mdoshQbG3uPwVNdchkwnhNAIu9L0mJyhD xrXkTVqVsqCDr2tN6Zg6JtUc43wqsWsiBmsbFtclQZqVe8sfzrQO/Hda7c1MJq3JQ7dP /FqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=XjDcxc7sQfpXSZ1klfFIU0xeG3PIJolrhiT/911tClE=; b=tSSzJOMysYeHqMGdWhG74RZYB4vuS0kk99kS6clv9ENKHlnrT3TfDX8vaV4zUFUcmS lmO8P1sZSxzNPR3An26Hl5W06HCJFEMSHeuIyUmC/KtmkVmT9Zm2/FLMCtJEWxM+7LS1 Uy2juBbxSFgbU1p2oyzLanLtSf093YLz30V+Vw35lGrpUbwTUF+eR5w3Jvkk3ee9US5S MRdvwBBlnxwXN42ShGsvM4423ROt0yoiLTW9ARQ06piyhPyuATI0r4imVC3zTIKDlwmm Woh2PNH5DlaCU/E/Hf3P6JCl0Q2UOz4OmAImRs9GOwmutxY9HB+rlFQbWF2aUdC0d4Ns PlEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fppqyvuM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f193-20020a636aca000000b003fc9b052e00si30843137pgc.771.2022.06.09.08.33.59; Thu, 09 Jun 2022 08:34:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fppqyvuM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1344328AbiFIPQN (ORCPT + 99 others); Thu, 9 Jun 2022 11:16:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344338AbiFIPQD (ORCPT ); Thu, 9 Jun 2022 11:16:03 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89ACB419A4; Thu, 9 Jun 2022 08:15:53 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id a10so22416511ioe.9; Thu, 09 Jun 2022 08:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=XjDcxc7sQfpXSZ1klfFIU0xeG3PIJolrhiT/911tClE=; b=fppqyvuMKJGHBPZhOK9EHVChnvSGKHOdURrkPjnlsrlvdZKmkYaOIaxbtFXgTCyHqJ s4nXebMun2v4vxvvUiYsTwNPFRrv/FceI9cL+qXIFGy9o2eK6PSIClX1cIP38yUCUQuM gE8/+tDPpMivdu8kZIgr4kpEu1ISRqDBT7MP6aEG0nKEvT6mYqRgKIn8nAbGv2zFszzy WPZ9u+0lR6Pl1uSMkZURCgEQ39zUJ5tsZ3nJaiwinfN4Rr6hKZ1Jo9CvyS6Rne3Zf4zW WRH+oqkVprKah3fNVLiDbGMMUFagBUWSmYdVcDqp0O3M8yaoYJ1Nr/xnHkxpwGPhTClg Dpkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=XjDcxc7sQfpXSZ1klfFIU0xeG3PIJolrhiT/911tClE=; b=oXPtbWUfZr2aNyUeK6173gVetTjOhK41hLeWVOKAuOpdvGYioGoS9x9YriRuq9ITBu 78Zg0sqwqvf77UQQw8wX/HLzT4mmjS6RQDeQMRcjsZtE1thjni4ZAg5qVg5WYwWqGrhE OBqu6DYr+m2QN2UMMF06CVICmPs2Wx4YC55c9XLnEuvvRrfDn4RoR9Uqmg+xggUb6Pxs CJm+GglhqW4BIPwpq+n2MzOxkolpxwI+J/PPwwxPaQA8xAOmBczkvUSg7JG4o0zEl2lE 6tTy2gb/8tYYY0SgsCHCNHOBi/+6lGXNQ2tkQgYuRIFibpC4scTUfaUCIYF3LG+eVf26 2RYA== X-Gm-Message-State: AOAM53321Y7aR0ALM+YH6JAGhcsSIc8kYriy0mcPyo4ko36EgMIad1YZ 3UDLaPg8Xob2ZFVLpenmaEs5HQ1RNWJpHNTg X-Received: by 2002:a02:a313:0:b0:331:7bfc:9830 with SMTP id q19-20020a02a313000000b003317bfc9830mr17152543jai.2.1654787752977; Thu, 09 Jun 2022 08:15:52 -0700 (PDT) Received: from Sassy (bras-base-oshwon9562w-grc-61-184-146-75-18.dsl.bell.ca. [184.146.75.18]) by smtp.gmail.com with ESMTPSA id i131-20020a6bb889000000b00669ae49f762sm1008064iof.19.2022.06.09.08.15.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 08:15:52 -0700 (PDT) Date: Thu, 9 Jun 2022 11:15:51 -0400 From: Srivathsan Sivakumar To: Manish Chopra , GR-Linux-NIC-Dev@marvell.com, Coiby Xu , Greg Kroah-Hartman Cc: netdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] staging: qlge: qlge_main.c: convert do-while loops to for loops Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org simplify do-while loops to for loops Signed-off-by: Srivathsan Sivakumar --- drivers/staging/qlge/qlge_main.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c index 8c35d4c4b851..308e8b621185 100644 --- a/drivers/staging/qlge/qlge_main.c +++ b/drivers/staging/qlge/qlge_main.c @@ -3006,13 +3006,13 @@ static int qlge_start_rx_ring(struct qlge_adapter *qdev, struct rx_ring *rx_ring cqicb->flags |= FLAGS_LL; /* Load lbq values */ tmp = (u64)rx_ring->lbq.base_dma; base_indirect_ptr = rx_ring->lbq.base_indirect; - page_entries = 0; - do { - *base_indirect_ptr = cpu_to_le64(tmp); - tmp += DB_PAGE_SIZE; - base_indirect_ptr++; - page_entries++; - } while (page_entries < MAX_DB_PAGES_PER_BQ(QLGE_BQ_LEN)); + + for (page_entries = 0; page_entries < + MAX_DB_PAGES_PER_BQ(QLGE_BQ_LEN); page_entries++) { + *base_indirect_ptr = cpu_to_le64(tmp); + tmp += DB_PAGE_SIZE; + base_indirect_ptr++; + } cqicb->lbq_addr = cpu_to_le64(rx_ring->lbq.base_indirect_dma); cqicb->lbq_buf_size = cpu_to_le16(QLGE_FIT16(qdev->lbq_buf_size)); @@ -3023,13 +3023,13 @@ static int qlge_start_rx_ring(struct qlge_adapter *qdev, struct rx_ring *rx_ring cqicb->flags |= FLAGS_LS; /* Load sbq values */ tmp = (u64)rx_ring->sbq.base_dma; base_indirect_ptr = rx_ring->sbq.base_indirect; - page_entries = 0; - do { - *base_indirect_ptr = cpu_to_le64(tmp); - tmp += DB_PAGE_SIZE; - base_indirect_ptr++; - page_entries++; - } while (page_entries < MAX_DB_PAGES_PER_BQ(QLGE_BQ_LEN)); + + for (page_entries = 0; page_entries < + MAX_DB_PAGES_PER_BQ(QLGE_BQ_LEN); page_entries++) { + *base_indirect_ptr = cpu_to_le64(tmp); + tmp += DB_PAGE_SIZE; + base_indirect_ptr++; + } cqicb->sbq_addr = cpu_to_le64(rx_ring->sbq.base_indirect_dma); cqicb->sbq_buf_size = cpu_to_le16(SMALL_BUFFER_SIZE); -- 2.34.1