Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3731247pxj; Tue, 15 Jun 2021 07:30:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRIBddqZZi4RQe7h4Rrv/vjjU0nDRtWr8gsAeBO07vfIg5EnA+PHujoUjuMmkOBmhfJrrY X-Received: by 2002:a05:6638:23a:: with SMTP id f26mr3554760jaq.6.1623767437974; Tue, 15 Jun 2021 07:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623767437; cv=none; d=google.com; s=arc-20160816; b=KoHzpRwdacPnlkEYn3P1LKiWU/jaT+vTH76Z96jUFOo3quqkKs+Gj84+vOO7BKlf26 hWUfpajpp+r8GUJ1j/VxWfDBj6uAyXS64rEeVTdST1kByQfoEE8mcvqPKg60LY3Xbotj DuOwn15YbriwFzeH4tqjqLQ5AO3Cr33xbaWVnA22qrS1gZfAbypqObeBtXFmDeMDTyFp 0bOsCzy2+3VlXK774lol6DvAV9L9QDcjtAzGOv1ANcXqXWG0vfMht5CsMPQm9Sxc4lJN C/FVbMjIzssAxykTXWg5613G+JcdEVsxkZk270eFfAJ7LDBxtD0av5Y463EU83sYwVT1 jrHQ== 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 :message-id:date:subject:cc:to:from; bh=X3Bah64eaSXQ7UMD8LNsFptM9rXCOV0QsYEODT7/Srk=; b=xVeENDjW8uE01tC12raBbYhPkRXyqWBxsxmqfV7UCEP2EDMNdTcQJWlLWIbkF2p/TQ 1WlOUWQtFOWTDSPjvGlHIf4w3vCXkin0pVxk96VIIqX922+mH0eXNtKU498RrwEbgLkQ bDxTd0uhOyaHUW2lpE0LabHODpcJB6N2UcinvlNHVtmJJ3ybxiuNni6yL5cjD3tJkqNn GQU5Nj7U4Cq271w7jsPWjPpNzlTC86GEi+nsdAZk7zphCE0vPK+jCSIk6l5BbvKsw79A ltM6wqnwEG6w5tRlUq77/pNgUTTzFnohJvLKRTo9KqJG0NpmUDhcNIL87V18+C5PqJ1H eLnQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r20si18767243ilj.127.2021.06.15.07.30.25; Tue, 15 Jun 2021 07:30:37 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230493AbhFOOa7 (ORCPT + 99 others); Tue, 15 Jun 2021 10:30:59 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:34093 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230322AbhFOOa5 (ORCPT ); Tue, 15 Jun 2021 10:30:57 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1ltA3b-00045E-Fl; Tue, 15 Jun 2021 14:28:47 +0000 From: Colin King To: Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Jakub Kicinski , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] ice: remove redundant continue statement in a for-loop Date: Tue, 15 Jun 2021 15:28:47 +0100 Message-Id: <20210615142847.60161-1-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The continue statement in the for-loop is redundant. Re-work the hw_lock check to remove it. Addresses-Coverity: ("Continue has no effect") Signed-off-by: Colin Ian King --- drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c index 267312fad59a..3eca0e4eab0b 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c @@ -410,13 +410,11 @@ bool ice_ptp_lock(struct ice_hw *hw) for (i = 0; i < MAX_TRIES; i++) { hw_lock = rd32(hw, PFTSYN_SEM + (PFTSYN_SEM_BYTES * hw->pf_id)); hw_lock = hw_lock & PFTSYN_SEM_BUSY_M; - if (hw_lock) { - /* Somebody is holding the lock */ - usleep_range(10000, 20000); - continue; - } else { + if (!hw_lock) break; - } + + /* Somebody is holding the lock */ + usleep_range(10000, 20000); } return !hw_lock; -- 2.31.1