Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2228499imm; Thu, 20 Sep 2018 09:39:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZIGfEUa/RWCnigRX4JOq1MHIWewC/e6krFVPGFNtRhe8Wgmc9CnAaFDr/N/KK7DxKgRWfO X-Received: by 2002:a63:d54e:: with SMTP id v14-v6mr38395050pgi.264.1537461588703; Thu, 20 Sep 2018 09:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537461588; cv=none; d=google.com; s=arc-20160816; b=dAXwJJ4Y0bYX5nudNJpPuXGWP80l+k8ddVPlaAeIkIhl+y+0wXuElTB6kIWYf50e6A uNtPteSw4H50rmSS5QlmPeGQHrjMF9/T0IWVsFGZqGv0nqa4hH1GFWGRt0TIfggWmiA0 M+hE6iFq/WKQOpg7CgYtLVrpJhbZeIJNo+8YpQLdKixkaJTu1i46dQK5Z6QbH4624fiG ZYb69UrcS4y0E60KgQFSCSmhyT9IxJR0pt7l9jQvFKaOHhgeb9XYH4LKIwmn3Xpp8+qh IwcPJQg83TcgTjatJbfHPe0vzOHHqF1j0hpKCH2ad+W49V19N9Owef4Ll39DmaeizW1+ TyQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=hXkOWKr79irQebrEhdECzLeU3ACL8OkvnergRcmaUlM=; b=j2NGdKpAn4kCtNzdca46cwKR6qiXynoIqW8qz7OG1auUwifhye/BzyLVQRwGX9Q0K4 XVuqOL+DpJTw5Krn0frx4UezYEHBxnVHf3ISL5mkUyuDdAmQpv85GKXrBkKCVPMFBdw6 wrGGA3F4tLiiKUx+o86rSdBhnBrPgLozq7eVCvtxuPUNqMIx+2eTkhVaKhLAjWqR3N7N QC6cic1Qt3QtxBRbDD0/U09EehawbyihJ1+qIvOdWwnFSY+P79AtbyOYNhJVaTr2Iv5X yQ/x6hvpHzh1k0p6p3ZmL45v3pmuy36CcCiLXk73I7NaT1P9+IShIN9mMOYXK1dvclcA DvlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=pw756e3S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d38-v6si24519178pla.422.2018.09.20.09.39.32; Thu, 20 Sep 2018 09:39:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=pw756e3S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728444AbeITWXW (ORCPT + 99 others); Thu, 20 Sep 2018 18:23:22 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43310 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727094AbeITWXW (ORCPT ); Thu, 20 Sep 2018 18:23:22 -0400 Received: by mail-qk1-f193.google.com with SMTP id 130-v6so5416541qkd.10 for ; Thu, 20 Sep 2018 09:39:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=hXkOWKr79irQebrEhdECzLeU3ACL8OkvnergRcmaUlM=; b=pw756e3SD92E/5glK5+o2k0tC0UonmSnTiUf62ke25qj+wHyWKc6QBqa1174o5D2Vy MAVPEZtRUWo7QgFaVxwQcjEcYPKY5S6htfok/OrZ1ONvyhnnE9CbcrjTpfU6yEwkM3sS v/od05Y59u+Iv+sE5lc4Xgxf9lQhgmwsS46dgZRcCKmD+CWEM6PmN8Q2Z2RmB07wQQkN lsjxHOXRDAbL18upg7POP22WF17Du4UvaBpqpw2wI5kRsSsxnWMzxeaRbS9cbnUMCr+7 3ghG6K5xuzIqPx5irQgxcUNbdni9Eds4zzuH2H6SjlrnZa9BSejRXlyCuJypApLyabtz zgYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=hXkOWKr79irQebrEhdECzLeU3ACL8OkvnergRcmaUlM=; b=eL//pER27BIVY4Rji/7E6ClHmsfGg+asVReDRhW9NnJti+qOOEuDRUuFsB4uzjtyr7 M2BTodQ3Kpe7X6TbBdvUSEWzkk3bBJg7sHErOXfn3kPAWlAGV8hlS1T2Gf4V2BOyWZfr sUw8D9unqJVlZ5SZV0K9EZz64TYPwjV3YesEyyN/Rb1OR7+E0aPe1sisRHt3SS5Z35fk ypsUr3S+pTnTKEb2fxi07DG1AJKNpEAkLKcVN0F079KLlavIpWXiwBQnbj5hn/o9BuSp jsZXVh2T7Es/q6L6MCN+WmS91t8A5jRK9O3TKxka7mUVKQhaqWhwVb/0W3MKTNnjWqB3 ZdJQ== X-Gm-Message-State: APzg51AZJcb8wKgnF502UYWWV1K300Ei7O/mUDv21f5etA70TumEbb/y yqtMbG5IwvPFBWvhd+W2en5NEg== X-Received: by 2002:ad4:5052:: with SMTP id m18-v6mr29219149qvq.164.1537461541903; Thu, 20 Sep 2018 09:39:01 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id p22-v6sm8783768qtk.29.2018.09.20.09.39.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 09:39:01 -0700 (PDT) Date: Thu, 20 Sep 2018 09:38:57 -0700 From: Jakub Kicinski To: zhong jiang Cc: , , , , Subject: Re: [PATCH] net: netronome: remove redundant continue Message-ID: <20180920093857.6227710f@cakuba.netronome.com> In-Reply-To: <1537430541-37817-1-git-send-email-zhongjiang@huawei.com> References: <1537430541-37817-1-git-send-email-zhongjiang@huawei.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Sep 2018 16:02:21 +0800, zhong jiang wrote: > The continue will not truely skip any code. hence it is safe to > remove it. > > Signed-off-by: zhong jiang I think this came up during review at some point. I still prefer to keep the continue. The body of the loop performs initialization of objects, if an object is removed we shouldn't carry on with the body. It's easy to miss that the object got freed otherwise, there is no error being set and no warning printed... > diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c > index 0b1ac9c..50d7b58 100644 > --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c > +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c > @@ -230,10 +230,8 @@ static void nfp_net_pf_free_vnics(struct nfp_pf *pf) > ctrl_bar += NFP_PF_CSR_SLICE_SIZE; > > /* Kill the vNIC if app init marked it as invalid */ > - if (nn->port && nn->port->type == NFP_PORT_INVALID) { > + if (nn->port && nn->port->type == NFP_PORT_INVALID) > nfp_net_pf_free_vnic(pf, nn); > - continue; > - } > } > > if (list_empty(&pf->vnics))