From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87505CA9EC9 for ; Thu, 31 Oct 2019 02:09:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57CF620862 for ; Thu, 31 Oct 2019 02:09:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="neFaPwdU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726829AbfJaCJj (ORCPT ); Wed, 30 Oct 2019 22:09:39 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:41899 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbfJaCJi (ORCPT ); Wed, 30 Oct 2019 22:09:38 -0400 Received: by mail-qk1-f195.google.com with SMTP id m125so5236394qkd.8; Wed, 30 Oct 2019 19:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9gGxsqz2ap3fWHU1T7SJzHxfkL9fiW1B2i5/1UDDuY4=; b=neFaPwdUmDFj5tlUjM/4S8UWVJO7OBBHelnvSZYEZ9QZmFFp0CJFojg+LG/GtIOj+s dOK5w+YQiSRFI58Pr10Tb7NHYRy9uAbeEuylAiVB39g26u9Q+ADGH9wpEgEIPB9Lt7Xk mbJP44V26LaB6jN5qk5c9wfnnUARJLhckB1qKwCMIHFhhXAgOBIcLSwp0OuxZkCOjz2w wMGmOr19mRr+DTclzEMT2PIMWc1LZAkn4btO6ijwCuNMWYCdeVmxgyQUmT7rgqS3YmQp V600XY7obXzEoPPCZWKkKvp52UXSaKBO1fJPL3rB4gpUL+aNvJnQncnTW/dqlguB+/2h K7ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9gGxsqz2ap3fWHU1T7SJzHxfkL9fiW1B2i5/1UDDuY4=; b=g4DuuufZjOeif+x9nUpgX4FaFZpd/k1QIKX70tfgpjAcZ99akVKIGV+Q0cUShmb1fa 6PTMX31m4z0AEyo877pCbbLPCz094mfhZ0040oH+ghuHoZYqAJ7egiOU7H3ItqbaV2qH jGslJwM5RZrpAfjo63Gqu991dTMjkCTfQWBeyvSokDsTmuZ0ZJ1/KyJkDNIg0uZTXrPq x2/UX4EgHhn0dXrEgYCl+L9dCYveey6NrFhQGP+XfUXN+lQ3OPRc8mmUfRZxr9mfJTp6 p4G21q7BPO3Y/i9GHLdcPEHJ/P3FcLylDxwLWdecEiWhQJ7VLbKUbyTjFj+LnB28LSPR AttQ== X-Gm-Message-State: APjAAAUCEn63qLttdEBoYTK9XBBlnY3q+6XjJ4T7qYbUupfLd1dSR+Od Xq2E6Wbstqdl92Q6oTOx2dk= X-Google-Smtp-Source: APXvYqzM9Cv/eBogir5yjZZlUuQNNOde0BjIgqM340YgiWT5/xw9dBWSPPsK5e0PVfABEOpwVgwo/g== X-Received: by 2002:ae9:f80d:: with SMTP id x13mr3185994qkh.63.1572487777633; Wed, 30 Oct 2019 19:09:37 -0700 (PDT) Received: from localhost (modemcable249.105-163-184.mc.videotron.ca. [184.163.105.249]) by smtp.gmail.com with ESMTPSA id r36sm1353041qta.27.2019.10.30.19.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 19:09:37 -0700 (PDT) From: Vivien Didelot To: "David S. Miller" Cc: linux-kernel@vger.kernel.org, Vivien Didelot , Florian Fainelli , Andrew Lunn , netdev@vger.kernel.org Subject: [PATCH net-next v2 3/7] net: dsa: remove switch routing table setup code Date: Wed, 30 Oct 2019 22:09:15 -0400 Message-Id: <20191031020919.139872-4-vivien.didelot@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191031020919.139872-1-vivien.didelot@gmail.com> References: <20191031020919.139872-1-vivien.didelot@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dsa_switch structure has no routing table specific data to setup, so the switch fabric can directly walk its ports and initialize its routing table from them. This allows us to remove the dsa_switch_setup_routing_table function. Signed-off-by: Vivien Didelot --- net/dsa/dsa2.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index efd7453f308e..a887231fff13 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c @@ -176,14 +176,13 @@ static bool dsa_port_setup_routing_table(struct dsa_port *dp) return true; } -static bool dsa_switch_setup_routing_table(struct dsa_switch *ds) +static bool dsa_tree_setup_routing_table(struct dsa_switch_tree *dst) { - struct dsa_switch_tree *dst = ds->dst; bool complete = true; struct dsa_port *dp; list_for_each_entry(dp, &dst->ports, list) { - if (dp->ds == ds && dsa_port_is_dsa(dp)) { + if (dsa_port_is_dsa(dp)) { complete = dsa_port_setup_routing_table(dp); if (!complete) break; @@ -193,25 +192,6 @@ static bool dsa_switch_setup_routing_table(struct dsa_switch *ds) return complete; } -static bool dsa_tree_setup_routing_table(struct dsa_switch_tree *dst) -{ - struct dsa_switch *ds; - bool complete = true; - int device; - - for (device = 0; device < DSA_MAX_SWITCHES; device++) { - ds = dst->ds[device]; - if (!ds) - continue; - - complete = dsa_switch_setup_routing_table(ds); - if (!complete) - break; - } - - return complete; -} - static struct dsa_port *dsa_tree_find_first_cpu(struct dsa_switch_tree *dst) { struct dsa_port *dp; -- 2.23.0