summaryrefslogtreecommitdiffstats
path: root/drivers/net/pcs
diff options
context:
space:
mode:
authorSerge Semin <fancer.lancer@gmail.com>2024-02-22 18:58:20 +0100
committerDavid S. Miller <davem@davemloft.net>2024-02-26 14:09:08 +0100
commit0ffc3292c02b7f16dd23d841b8c4766c48edfdc7 (patch)
tree27553c13e1a43735de8ad4cbdb6b7e7f784b0ea1 /drivers/net/pcs
parentMerge branch 'rtnetlink-reduce-rtnl-pressure' (diff)
downloadlinux-0ffc3292c02b7f16dd23d841b8c4766c48edfdc7.tar.xz
linux-0ffc3292c02b7f16dd23d841b8c4766c48edfdc7.zip
net: pcs: xpcs: Drop sentinel entry from 2500basex ifaces list
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pcs')
-rw-r--r--drivers/net/pcs/pcs-xpcs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 52a7757ee419..9a46c054cd94 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);