History

net: phy: improve definition of __ETHTOOL_LINK_MODE_MASK_NBITS

The way to define __ETHTOOL_LINK_MODE_MASK_NBITS seems to be overly complicated, go with a standard approach instead. Whilst we're at it, move the comment to the right place. v2: - rebased

Heiner Kallweit committed 7 years ago

Commit e728fdf1 parent fad42712 files · +9 −12Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/ethtool.h+9−8
@@ -1432,6 +1432,13 @@ enum ethtool_link_mode_bit_indices { · 1431 unmodified lines
14321432 ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29,
14331433 ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30,
14341434 ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31,
1435+
1436+ /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
1437+ * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
1438+ * macro for bits > 31. The only way to use indices > 31 is to
1439+ * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API.
1440+ */
1441+
14351442 ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32,
14361443 ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33,
14371444 ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34,
@@ -1469,14 +1476,8 @@ enum ethtool_link_mode_bit_indices { · 31 unmodified lines
14691476 ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 65,
14701477 ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 66,
14711478
1472− /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
1473− * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
1474− * macro for bits > 31. The only way to use indices > 31 is to
1475− * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API.
1476− */
1477−
1478− __ETHTOOL_LINK_MODE_LAST
1479− = ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT,
1479+ /* must be last entry */
1480+ __ETHTOOL_LINK_MODE_MASK_NBITS
14801481 };
14811482
14821483 #define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name) \