Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp37299pxj; Wed, 16 Jun 2021 19:36:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhXr4+dTfTbPaICtuCGOzczIahGl9MkcFovnIZKnQs0kGk7kVGaj8H7cx6CWhpOEi0SB5x X-Received: by 2002:a17:907:206b:: with SMTP id qp11mr2635668ejb.336.1623897388802; Wed, 16 Jun 2021 19:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623897388; cv=none; d=google.com; s=arc-20160816; b=TBdPjpHkYV38t/qzlCpfkq3eS8Kytw/e1gxFmoE90mDHJJ8H9+KzikEdo55duRZGg7 BySp4GCDW3YLqh3TsKUfK398SWTq/ISf4j0ewEvjZAuRbsHdISa8tLhqftFcqLNC8Sco nC4eDtDSTkB/skTYYWZp1mr0Rh2yZV/HY7U/W1+UDW2NL4oLh3okcPhlIbWklWENMow4 rHeNB1Zi+SW7W08d0cWdKRpA5ltBHGQECtuM0z/Jcq6L/0f5JaoKVvjLIJqOSmlQ8h/W jwt+g4lMciszcGPorHNuepJnelmRHq7Kv7jOKNjGUuvbQijMUCIxi6PF6cFg2E3ghhfI CUrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=hUyGvJrbYfaZC+nOIKMCrEnFkfqh3tG+ftrxl04k9HM=; b=if6cb55imTuHFMDLrpaUzN51/YWjpuLLkYk7JoCgjSdVqefMOHCwYeMd1Tyfq8ipsI 2o9Wqw4ObbNjG2urAFTHjqEYGOr+n9kD05t1+7eYu0efJAAqo3V8l9T+zsUJyqC4namV iE9/st8AZQ6j9xYp0zSil30KAcT6tUNdCpRFpzHnCCuZnuugdu1mHlgpf2st5sNZbdUU G3qTCrbx7dYADQdwxdLSBUW4OOZtX+67GzT6O7SkHGu0q0RboT88av8iQf3/zhuP/+DE 3lueCKXxG2gt7NZrohQol4UQKFBO5P6gfSNFOqv3BIqdyq5iuSKuCV+D20+zMtHaMpuQ kjHA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 11si4002619ejm.321.2021.06.16.19.36.06; Wed, 16 Jun 2021 19:36:28 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234583AbhFPXaD (ORCPT + 99 others); Wed, 16 Jun 2021 19:30:03 -0400 Received: from mga06.intel.com ([134.134.136.31]:30915 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234508AbhFPXaD (ORCPT ); Wed, 16 Jun 2021 19:30:03 -0400 IronPort-SDR: 9Fl8ijXuZvj1oEDZcUZ+JKxEr5QmhhgIVu9MjzrjBWBbzjTQDlIvmAr0lSZmZrgUCXgNgD0Jh5 XB9iCLay9VcA== X-IronPort-AV: E=McAfee;i="6200,9189,10017"; a="267420483" X-IronPort-AV: E=Sophos;i="5.83,278,1616482800"; d="scan'208";a="267420483" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2021 16:27:53 -0700 IronPort-SDR: c/uhERQyM+sCgOUqZHbGxAylMWWwjSLqhn+8dqVDprMkHlPe6u7GA6VFA4cVP64YtyRNR/QyBq +DtCdxpl9d1A== X-IronPort-AV: E=Sophos;i="5.83,278,1616482800"; d="scan'208";a="479269628" Received: from jekeller-mobl1.amr.corp.intel.com (HELO [10.209.42.204]) ([10.209.42.204]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2021 16:27:52 -0700 Subject: Re: [PATCH][next] ice: remove redundant continue statement in a for-loop To: Colin King , 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 References: <20210615142847.60161-1-colin.king@canonical.com> From: Jacob Keller Organization: Intel Corporation Message-ID: <2a347503-9879-0a13-555b-a007acfdec3c@intel.com> Date: Wed, 16 Jun 2021 16:27:50 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210615142847.60161-1-colin.king@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/15/2021 7:28 AM, Colin King wrote: > 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 > --- Yep, that logic makes more sense. Reviewed-by: Jacob Keller > 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; >