From: Serge Semin <fancer.lancer@gmail.com>
To: Jose Abreu <joabreu@synopsys.com>,
Jose Abreu <Jose.Abreu@synopsys.com>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Jakub Kicinski <kuba@kernel.org>,
Vladimir Oltean <olteanv@gmail.com>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>
Cc: Serge Semin <fancer.lancer@gmail.com>,
Mengyuan Lou <mengyuanlou@net-swift.com>,
Tomer Maimon <tmaimon77@gmail.com>,
Jiawen Wu <jiawenwu@trustnetic.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
openbmc@lists.ozlabs.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: [PATCH net-next v2 1/4] net: pcs: xpcs: Drop sentinel entry from 2500basex ifaces list
Date: Thu, 22 Feb 2024 20:58:20 +0300 [thread overview]
Message-ID: <20240222175843.26919-2-fancer.lancer@gmail.com> (raw)
In-Reply-To: <20240222175843.26919-1-fancer.lancer@gmail.com>
There are currently only two methods (xpcs_find_compat() and
xpcs_get_interfaces()) defined in the driver which loop over the available
interfaces. All of them rely on the xpcs_compat::num_interfaces field
value to get the total number of supported interfaces. Thus the interface
arrays are supposed to be filled with actual interface IDs and there is no
need in the dummy terminating ID placed at the end of the arrays.
Based on the above drop the PHY_INTERFACE_MODE_MAX entry from the
xpcs_2500basex_interfaces array and the PHY_INTERFACE_MODE_MAX-based
conditional statement from the xpcs_get_interfaces() method as redundant.
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/pcs/pcs-xpcs.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 31f0beba638a..dc7c374da495 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -130,7 +130,6 @@ static const phy_interface_t xpcs_1000basex_interfaces[] = {
static const phy_interface_t xpcs_2500basex_interfaces[] = {
PHY_INTERFACE_MODE_2500BASEX,
- PHY_INTERFACE_MODE_MAX,
};
enum {
@@ -636,8 +635,7 @@ void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces)
const struct xpcs_compat *compat = &xpcs->id->compat[i];
for (j = 0; j < compat->num_interfaces; j++)
- if (compat->interface[j] < PHY_INTERFACE_MODE_MAX)
- __set_bit(compat->interface[j], interfaces);
+ __set_bit(compat->interface[j], interfaces);
}
}
EXPORT_SYMBOL_GPL(xpcs_get_interfaces);
--
2.43.0
next prev parent reply other threads:[~2024-02-22 17:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 17:58 [PATCH net-next v2 0/4] net: pcs: xpcs: Cleanups before adding MMIO dev support Serge Semin
2024-02-22 17:58 ` Serge Semin [this message]
2024-02-22 17:58 ` [PATCH net-next v2 2/4] net: pcs: xpcs: Drop redundant workqueue.h include directive Serge Semin
2024-02-22 17:58 ` [PATCH net-next v2 3/4] net: pcs: xpcs: Return EINVAL in the internal methods Serge Semin
2024-02-22 17:58 ` [PATCH net-next v2 4/4] net: pcs: xpcs: Explicitly return error on caps validation Serge Semin
2024-02-23 9:56 ` Maxime Chevallier
2024-02-26 13:10 ` [PATCH net-next v2 0/4] net: pcs: xpcs: Cleanups before adding MMIO dev support patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240222175843.26919-2-fancer.lancer@gmail.com \
--to=fancer.lancer@gmail.com \
--cc=Jose.Abreu@synopsys.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=jiawenwu@trustnetic.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maxime.chevallier@bootlin.com \
--cc=mengyuanlou@net-swift.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=openbmc@lists.ozlabs.org \
--cc=pabeni@redhat.com \
--cc=tmaimon77@gmail.com \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).