Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp506586ybx; Wed, 30 Oct 2019 19:12:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZ8x4RQuvVuC7dwUTeffKUlwfH5WCrBgAmUPwzxVDkRkxj4bV3Sw66ryQxgC1w7EmHCUCr X-Received: by 2002:a17:906:a981:: with SMTP id jr1mr1343867ejb.255.1572487941380; Wed, 30 Oct 2019 19:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572487941; cv=none; d=google.com; s=arc-20160816; b=Pshv3RZYCRhxqL+NDvFYqj05OgYAA25LFd0JsWUkdLdOTyJ+BbxzWfOlVA5PEdzkVh Ibjq5DlYmyYGiZfbsg8oREvPiQRTLDC2ZiQKe1csOZXw/fUpf3PXH1AUG4zxXHj7YV41 QHKf+B4nzz7hJ9jLZjTk70XSH6fmAPhix4iYbj7APw4FAqL9hDKHngsw2NKzh3YF0doM yHDUH9/giXxORhdIOMe3Uf2b1a1tfHtgHzkb0AWO/e/9cxgbxcTkKpq4ntnFFgFTOzex sCn3Q7hP7w6RHe7u9Y53v8fs8K4JT17D/iiAiIuwYbSR00CZBjQ664JH3xDlCxKv70RT qEqw== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=4W9AYepQ0ExS+WuRGCTZkKX0WkDwZNV6f0NYXF3lfA4=; b=H644SnDBW7T813UqW2ZLW3JezI/ZAbVO2FFc5VVyQr+QO9o7JnYqDF5e41Tork39Kf K6rn0gnAD2W6T2PrfTfsHznDzbD+m1Sf9WiQL9Sj6k+3my2dOFWLGB6jc0rqRn6fFl5t KT6dJ9nIn0DGClNRYUjUfoTgubt/mzCeq4iLgbSefAcuvfuPzl64iQ+9S5JxI7usrYRT Zd/475sA4m8R03KTX1ycAYKTvxLGd5gN0LWCLtgmgUK2kXZgSOVp8x9BS6zjX4AG9d54 krpt/228JAtbdcsPiIEVuPGbz2QtNCX9+3EqcvyEqh/w2iddogDgRr7DK7xlpJecBnO/ t8qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fTQUL8ld; 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 r18si2463038eji.95.2019.10.30.19.11.56; Wed, 30 Oct 2019 19:12:21 -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=fTQUL8ld; 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 S1726994AbfJaCKE (ORCPT + 99 others); Wed, 30 Oct 2019 22:10:04 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:35666 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726622AbfJaCJk (ORCPT ); Wed, 30 Oct 2019 22:09:40 -0400 Received: by mail-qt1-f196.google.com with SMTP id l3so6401998qtp.2; Wed, 30 Oct 2019 19:09:39 -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=4W9AYepQ0ExS+WuRGCTZkKX0WkDwZNV6f0NYXF3lfA4=; b=fTQUL8ldDYy7/7DQ++EenWXXcrkdo5WX2iU9NoTtViX2SucT8vFejJgUfNU1FMwwsG /mDOHWrDjT0A+8JDiBFF5ZI+lYM2C4/wEnnCglf5QJ4zsZieX563yQoRhwI6dgFh0MMe iEdY40hjBRqp4nYIhXucD7c3F9Sk/irtXR31Vxe9d9Qatw5pl8OgN6+9lbfcGbCiKGuC UNSgHMfUqGNp/HCX59yQ4lf6mjFHmblH5OKpHLWGHpBfm9ceI1JAhi23tvyXepu5E0ga 1osorECsVm9f28AHzI2Ygmbdvyis63xqoD3vn+/QfArpdrRyFSONRT2JhIFIC0Mg3qnP d6kQ== 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=4W9AYepQ0ExS+WuRGCTZkKX0WkDwZNV6f0NYXF3lfA4=; b=A+J8lebXLYUZzFreMADousS1fKiFdgdNKliYdlEeMv7wgZNJCv7n9ZrKtWBHVc/hDk JsFJcQV9uKJasJKLVxAlzgbg18FTE3NlSVMQkcualOvboJEswdBVAW/U+SzSkhRNAFAu lew59UywrkI89HMZOUxxOz3yYjD8XnDfYK9Q210BXW1AShjHphz5A0XfDZFDkc0TGIde ejs2jBoXvTsGXCJP32b67ye4xPkzzBEUvmOV4xRklezoN5QVPY5cVp3Az5FRaiJtHHCk bU9rXFsk+VItbUZ3Bm5EoxV8YPFHguINaqFRRH27/8CGq8+F0trLpw3OLf6bN6UtQHhb UrBQ== X-Gm-Message-State: APjAAAXWPuhMRpu+lfItCcWEGV3UrevER7Ud9WfM5ooU7SUD/ySv//6E wxWGfteOBrO3puJZrY1KIMPpzxiJ X-Received: by 2002:a0c:e8c5:: with SMTP id m5mr2374888qvo.183.1572487779276; Wed, 30 Oct 2019 19:09:39 -0700 (PDT) Received: from localhost (modemcable249.105-163-184.mc.videotron.ca. [184.163.105.249]) by smtp.gmail.com with ESMTPSA id f21sm1040966qte.36.2019.10.30.19.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 19:09:38 -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 4/7] net: dsa: remove the dst->ds array Date: Wed, 30 Oct 2019 22:09:16 -0400 Message-Id: <20191031020919.139872-5-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 Now that the DSA ports are listed in the switch fabric, there is no need to store the dsa_switch structures from the drivers in the fabric anymore. So get rid of the dst->ds static array. Signed-off-by: Vivien Didelot --- include/net/dsa.h | 5 ----- net/dsa/dsa2.c | 7 ------- 2 files changed, 12 deletions(-) diff --git a/include/net/dsa.h b/include/net/dsa.h index b46222adb5c2..e4c697b95c70 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h @@ -125,11 +125,6 @@ struct dsa_switch_tree { /* List of DSA links composing the routing table */ struct list_head rtable; - - /* - * Data for the individual switch chips. - */ - struct dsa_switch *ds[DSA_MAX_SWITCHES]; }; /* TC matchall action types, only mirroring for now */ diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c index a887231fff13..92e71b12b729 100644 --- a/net/dsa/dsa2.c +++ b/net/dsa/dsa2.c @@ -578,25 +578,18 @@ static void dsa_tree_remove_switch(struct dsa_switch_tree *dst, { dsa_tree_teardown(dst); - dst->ds[index] = NULL; dsa_tree_put(dst); } static int dsa_tree_add_switch(struct dsa_switch_tree *dst, struct dsa_switch *ds) { - unsigned int index = ds->index; int err; - if (dst->ds[index]) - return -EBUSY; - dsa_tree_get(dst); - dst->ds[index] = ds; err = dsa_tree_setup(dst); if (err) { - dst->ds[index] = NULL; dsa_tree_put(dst); } -- 2.23.0