Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp258018ybx; Wed, 30 Oct 2019 14:40:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwizZsKi+umgUhpPgn7xPbHNWMYq6AqhHhwa7EKF1I9dyXsor8kTZZrxSdKwX+0ZVzuZme X-Received: by 2002:a17:906:3ec8:: with SMTP id d8mr490421ejj.40.1572471652926; Wed, 30 Oct 2019 14:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572471652; cv=none; d=google.com; s=arc-20160816; b=Sz/MCXYjOjCvub/C/pxw7xmy9ydNTvaAbEcsolTGQWwA/wfEpGJmFgZqeefcConlhq vEcqKa1BoQH2X2rYtWOtU/c6RMIfpWQBWwYAAQURi/86C0htI9HDtOArmVkYKM1jq64X 5kIPh/MGToUSz4QtuO8vHmuw0+MvfVQP5fyQamd0BacGyNx4Xi4fsSR3BtwO3uMZ4qIM Kku0esAD8Et1cgCf5rqXryV2PRURoAd+REH4gwi1ltK3uL2Tb9M8TJnPR6RheeA0yNvM 1VirLf4pkmjOxc5FYrWg8A0e60nnp0vhvoAEaP+jCiMDsJD0OlLGrAwMGO/2NRVStIBU Gy0g== 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 :references:in-reply-to:from:subject:cc:to:message-id:date; bh=DJH5yVVm3AH/S3Q4GUR9dzUwoq6jcLqpNoIGuM8DGWY=; b=quTnB60Sv0kvVdNm08PeVi8899o/IsFEcoW6TI/iDPniehNtWE04BiTdB8N/Qx2IG/ 9Ca1yCRvm9RNoyf3CArOAEe8A5mVC/ZtQ6q9kZaBwWBUDs2Xkbl3tFo4FQus6hhG/J6T 7SZOut3nRetZMZvA+qSQtBm0m2qkKTYSeihg6q9DVjbKONVftZXlfnV02r8FAFTJO1gY ZY1pRt6zXYsKOYm+YDofVrgE6Z8IvyuJKFgTpnyz0fFmoyXXu+wHDLKYpHajvgUijLK3 rkKCnaBh4AUVOkfYyD8o1DawteDLeZF4MeD/t3VEHxEn45aQW1z/oVvEalOZ/B0P1iHP 9JkQ== ARC-Authentication-Results: i=1; mx.google.com; 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 q8si2683652edi.445.2019.10.30.14.40.29; Wed, 30 Oct 2019 14:40:52 -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; 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 S1727275AbfJ3Vjv (ORCPT + 99 others); Wed, 30 Oct 2019 17:39:51 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:46940 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbfJ3Vjv (ORCPT ); Wed, 30 Oct 2019 17:39:51 -0400 Received: from localhost (unknown [IPv6:2601:601:9f00:1e2::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 3EE6B14C6834A; Wed, 30 Oct 2019 14:39:50 -0700 (PDT) Date: Wed, 30 Oct 2019 14:39:49 -0700 (PDT) Message-Id: <20191030.143949.809392632168787466.davem@davemloft.net> To: vivien.didelot@gmail.com 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 From: David Miller In-Reply-To: <20191028195220.2371843-2-vivien.didelot@gmail.com> References: <20191028195220.2371843-1-vivien.didelot@gmail.com> <20191028195220.2371843-2-vivien.didelot@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 30 Oct 2019 14:39:50 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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);