Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp510548ybx; Wed, 30 Oct 2019 19:16:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKmDuUPKldXjm31C/ZFS5hSy0f02/9YD4iczwuEqF5GH4q4HXctBeSnKZkyzmgzdoZ+VaS X-Received: by 2002:a17:906:6011:: with SMTP id o17mr1367458ejj.172.1572488217434; Wed, 30 Oct 2019 19:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572488217; cv=none; d=google.com; s=arc-20160816; b=wwPk0RKIZUviARCCo4Qt6RaJnXo5dxTfiS3W+DusB+AHPlog8w2pTScI37w8WM6M/k X7Z6fkQtBIKcZLAfLk8pKgG7rg6WoxcJTqFQtSZiNJA8zvgQ+3JVrIjM6QFr/x/B6kuq ESz+Xu/piFfAYD1yoxwReJvSeaxp6r9J1Sx1a1AnIElX99fS1lOkuJps3yuN3nTloRjb hUGzc+3QqQjRTx0nXvKzu0SOqiHEuyUSVEZbxy/4/gbbKoP1EjED6Jsbt91KiE93NfVS 4t3ylgw4TFu7DUugU8vq7POfTXXZMSbD9/fdw4zQVfNO1iKnONjI1A7vQzpSdTb2Tvdl mVWw== 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 :content-disposition:mime-version:references:in-reply-to:subject:cc :to:from:message-id:date:dkim-signature; bh=nAtFBaF759uCGM4rCo8bYpeccOLVNQhATaaIk5meiKI=; b=n+6ioJ5nsY+6B8OW1UW4E/EGg/OzbWpSOcu9RgtOmZTCZpuJCCFMBVzY6mEoBGl8bz WUno930nsxFYAWJAIWi9q9jTKkHusWApSjNakfhBpqGh1R8a0T53dTaI3q6CfnkkwacY gXbztD82ZQK8NuCm8OgjyzZJxCvrIwaMRRhMkugUleiElRznv/A+LzkLllPfy3mkUdic s4AzEQlzz6LhnWe7IFx8O/9fsLM2p/f7lNA6AqtQZDgKfEma1AoEycYE02lBrKRkX3ON u4cqLVo4uUWGrvLqbXVUmvRWtTRGsUenOl4z6IHnl4ccqWzrYnEnzR1RipyQAKJGChKV U0xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c3PocsTu; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y40si2780775edd.383.2019.10.30.19.16.33; Wed, 30 Oct 2019 19:16:57 -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=@gmail.com header.s=20161025 header.b=c3PocsTu; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726671AbfJaCOa (ORCPT + 99 others); Wed, 30 Oct 2019 22:14:30 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:45314 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726184AbfJaCOa (ORCPT ); Wed, 30 Oct 2019 22:14:30 -0400 Received: by mail-qk1-f195.google.com with SMTP id q70so5215781qke.12; Wed, 30 Oct 2019 19:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:from:to:cc:subject:in-reply-to:references :mime-version:content-disposition:content-transfer-encoding; bh=nAtFBaF759uCGM4rCo8bYpeccOLVNQhATaaIk5meiKI=; b=c3PocsTubGHZc+Vdfn1oU6/MMIpEZbErwAP34Q4VEp2CMaXUWioeVpLJbmFYdo180W q8A6evE++Vj4HbXUb+1sIVXG75FoUAuhADZzeD0vvBrQS0OXlgta9T/bmH0uk9iPUttu PQ/WCJpcJp5dBi/XL9sKlsVQcNWMgIP72dHcX8WoMkqwakTY8I5HMhaYgsjQVZV7ZZB7 UAQqnzLp/24K0TrtcHNa6hje2aoicLTV6EKpp52n/cYwwhWsGrK0ges2rT88Rc5cGVCb ho6eCGyJ+ntuG9LIiJYOlzrSzqOLFjTZjVdSQjsdmGFNJ0zWh/8H9X+mwK2ViAu3x+fV 1TPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:from:to:cc:subject:in-reply-to :references:mime-version:content-disposition :content-transfer-encoding; bh=nAtFBaF759uCGM4rCo8bYpeccOLVNQhATaaIk5meiKI=; b=FueFiP8u5iDBoUEq+7JSJD0OweTr6xRyBjoesCaIqRRZBMiCZmsb9xZXkEOgQkOGRT gPss0vSAKFizZjvWpDVi0GmEy15oFcdYOOS0a5Boy//Lyym67dGMVpDr3WchaN1to171 7NZhI4rS4pUWIca2eOFVHr00Q8KUcGIJxv31oAtHSJqQz7RFYxDJbYeel2uLr2XjI9as psKAdTZjNDExO/JkwqMSFSHkRMwjlfBYLOCSXhjb56+RXX+eVTwpS2vdsBCKlcleXHTS W69nPc5kLmJGQPuuFs5uvm2F5iT3V1a4ZnfMTiszsPx/EFmD97+3JzU4JQTwzDD4WeYR 3DKQ== X-Gm-Message-State: APjAAAVcgw9EvoEzK9TVFvIdz/SFLll2TzKG2F2OOmMYPAZt9ASkhFfP Gru8qVBeq6GVxWrcPShY7ys= X-Received: by 2002:a05:620a:1010:: with SMTP id z16mr3126971qkj.496.1572488069580; Wed, 30 Oct 2019 19:14:29 -0700 (PDT) Received: from localhost (modemcable249.105-163-184.mc.videotron.ca. [184.163.105.249]) by smtp.gmail.com with ESMTPSA id v54sm1145242qtc.77.2019.10.30.19.14.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 19:14:29 -0700 (PDT) Date: Wed, 30 Oct 2019 22:14:28 -0400 Message-ID: <20191030221428.GB140471@t480s.localdomain> From: Vivien Didelot To: David Miller Cc: linux-kernel@vger.kernel.org, f.fainelli@gmail.com, andrew@lunn.ch, netdev@vger.kernel.org Subject: Re: [PATCH net-next 1/7] net: dsa: list DSA links in the fabric In-Reply-To: <20191030.143949.809392632168787466.davem@davemloft.net> References: <20191028195220.2371843-1-vivien.didelot@gmail.com> <20191028195220.2371843-2-vivien.didelot@gmail.com> <20191030.143949.809392632168787466.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David, On Wed, 30 Oct 2019 14:39:49 -0700 (PDT), David Miller wrote: > From: Vivien Didelot > Date: Mon, 28 Oct 2019 15:52:14 -0400 > > > @@ -122,6 +124,29 @@ static struct dsa_port *dsa_tree_find_port_by_node(struct dsa_switch_tree *dst, > > return NULL; > > } > > > > +struct dsa_link *dsa_link_touch(struct dsa_port *dp, struct dsa_port *link_dp) > > +{ > > + struct dsa_switch *ds = dp->ds; > > + struct dsa_switch_tree *dst = ds->dst; > > + struct dsa_link *dl; > > Please fix the reverse christmas tree here, two suggestions: > > struct dsa_switch *ds = dp->ds; > struct dsa_switch_tree *dst; > struct dsa_link *dl; > > dst = ds->dst; > > Or, alternatively, since the dst variable is used only once, get rid of it > and change: > > > + list_add_tail(&dl->list, &dst->rtable); > > to > > > + list_add_tail(&dl->list, &ds->dst->rtable); No problem, I've sent a v2 using the first suggestion, since dst is in fact used twice in this function. Thank you, Vivien