From patchwork Wed Jun 15 22:51:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alvin_=C5=A0ipraga?= X-Patchwork-Id: 12882996 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BFDEC433EF for ; Wed, 15 Jun 2022 22:51:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350576AbiFOWvj (ORCPT ); Wed, 15 Jun 2022 18:51:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350570AbiFOWvi (ORCPT ); Wed, 15 Jun 2022 18:51:38 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09A805641C for ; Wed, 15 Jun 2022 15:51:35 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id z7so18188729edm.13 for ; Wed, 15 Jun 2022 15:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pqrs.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AareH3Xp+hp4A5FOtY4uNivgTY9OEK29GzGPxmxFOws=; b=kJzpPcYmcX7GoYd5tKK+ollj2PRhF8lAkiyS3JW/xsbBypPJ1S6pWA7AwYOH4o1NNk TxuMrtWli9kiluVbcbl0Si+CK0BVPyD7C/b4zxvVTjOe1bm7iLzSbYQ+c/ZealIYX91u 2BfBxNLumPg8ZjKobTSfjtIDMh1WL/1QFD7hM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AareH3Xp+hp4A5FOtY4uNivgTY9OEK29GzGPxmxFOws=; b=O7QUz6nNQjTrPFE8yQqdSby+gj+qU6Ev6LjVcqHIoYBLNNUshtA5ieFcrD7PkAdW3J /OmCOSMiC948RT2r52ejK0bpe6cRn3jpdqv6tDLGp9OaCr9m0tDae7VjExw8Tce2hQl6 nyuruOxPrTYDwkzSJP2qZh3FXueiHEtrdxPZ073eeLdGebW5BWSuD/jDBjSQ0QHKpvZE t8D+zoWnh/0Vxu9PqaA80LDcx9QHQi++YrhNeztKC9+VUg/xNf++UhNxrqmgOtEeuoy0 Ky+mKADAv6f0lXjlz3WTc3Osp2/qc+1foioDJAUQ0r16DoYnvTYNyd8aHH+NBxry0lSh Xy6w== X-Gm-Message-State: AJIora8qLR5eea1xnjpnFAmHwaKvM7hRNL8AwodnGyy+q7/vZ4dsgolF Rmg7+i4EV2k54Xo28W5uZnt4cw== X-Google-Smtp-Source: AGRyM1s8HNefBTr6EzDUrhiYqbINKuXkV+4Hc+kGEYoKgOE1r08kg/gFh3kyeRMAURVZ7aQz2TD0vA== X-Received: by 2002:a05:6402:329b:b0:431:3143:5ced with SMTP id f27-20020a056402329b00b0043131435cedmr2648926eda.257.1655333493599; Wed, 15 Jun 2022 15:51:33 -0700 (PDT) Received: from localhost.localdomain (80.71.142.18.ipv4.parknet.dk. [80.71.142.18]) by smtp.gmail.com with ESMTPSA id h23-20020aa7c617000000b0042e21f8c412sm371506edq.42.2022.06.15.15.51.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 15:51:33 -0700 (PDT) From: =?utf-8?q?Alvin_=C5=A0ipraga?= To: hauke@hauke-m.de, Linus Walleij , =?utf-8?q?Al?= =?utf-8?q?vin_=C5=A0ipraga?= , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v3 4/5] net: dsa: realtek: rtl8365mb: remove learn_limit_max private data member Date: Thu, 16 Jun 2022 00:51:14 +0200 Message-Id: <20220615225116.432283-5-alvin@pqrs.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220615225116.432283-1-alvin@pqrs.dk> References: <20220615225116.432283-1-alvin@pqrs.dk> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Alvin Šipraga The variable is just assigned the value of a macro, so it can be removed. Signed-off-by: Alvin Šipraga --- drivers/net/dsa/realtek/rtl8365mb.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/dsa/realtek/rtl8365mb.c b/drivers/net/dsa/realtek/rtl8365mb.c index 3599fa5d9f14..676b88798976 100644 --- a/drivers/net/dsa/realtek/rtl8365mb.c +++ b/drivers/net/dsa/realtek/rtl8365mb.c @@ -563,7 +563,6 @@ struct rtl8365mb_port { * @irq: registered IRQ or zero * @chip_id: chip identifier * @chip_ver: chip silicon revision - * @learn_limit_max: maximum number of L2 addresses the chip can learn * @cpu: CPU tagging and CPU port configuration for this chip * @mib_lock: prevent concurrent reads of MIB counters * @ports: per-port data @@ -577,7 +576,6 @@ struct rtl8365mb { int irq; u32 chip_id; u32 chip_ver; - u32 learn_limit_max; struct rtl8365mb_cpu cpu; struct mutex mib_lock; struct rtl8365mb_port ports[RTL8365MB_MAX_NUM_PORTS]; @@ -1088,15 +1086,13 @@ static void rtl8365mb_port_stp_state_set(struct dsa_switch *ds, int port, static int rtl8365mb_port_set_learning(struct realtek_priv *priv, int port, bool enable) { - struct rtl8365mb *mb = priv->chip_data; - /* Enable/disable learning by limiting the number of L2 addresses the * port can learn. Realtek documentation states that a limit of zero * disables learning. When enabling learning, set it to the chip's * maximum. */ return regmap_write(priv->map, RTL8365MB_LUT_PORT_LEARN_LIMIT_REG(port), - enable ? mb->learn_limit_max : 0); + enable ? RTL8365MB_LEARN_LIMIT_MAX : 0); } static int rtl8365mb_port_set_isolation(struct realtek_priv *priv, int port, @@ -2003,7 +1999,6 @@ static int rtl8365mb_detect(struct realtek_priv *priv) mb->priv = priv; mb->chip_id = chip_id; mb->chip_ver = chip_ver; - mb->learn_limit_max = RTL8365MB_LEARN_LIMIT_MAX; mb->jam_table = rtl8365mb_init_jam_8365mb_vc; mb->jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc);