net: sfp-bus: constify link_modes to sfp_select_interface()
Subsystems (4)
PATCH 1/1 net: sfp-bus: constify link_modes to sfp_select_interface()
sfp_select_interface() does not modify its link_modes argument, so make this a const pointer.
--- drivers/net/phy/sfp-bus.c | 2 +- include/linux/sfp.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/sfp-bus.c +1 -1
@@ -355,7 +355,7 @@ EXPORT_SYMBOL_GPL(sfp_parse_support);* modes mask. */ phy_interface_t sfp_select_interface (struct sfp_bus *bus, -unsigned long *link_modes) +const unsigned long *link_modes) { if (phylink_test(link_modes, 25000baseCR_Full) || phylink_test(link_modes, 25000baseKR_Full) ||
include/linux/sfp.h +2 -2
@@ -554,7 +554,7 @@ bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id);void sfp_parse_support (struct sfp_bus *bus,const struct sfp_eeprom_id *id,unsigned long *support,unsigned long *interfaces);phy_interface_t sfp_select_interface (struct sfp_bus *bus, -unsigned long *link_modes); +const unsigned long *link_modes);int sfp_get_module_info (struct sfp_bus *bus,struct ethtool_modinfo *modinfo); int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee,
@@ -593,7 +593,7 @@ static inline void sfp_parse_support(struct sfp_bus *bus, }static inline phy_interface_t sfp_select_interface (struct sfp_bus *bus, -unsigned long *link_modes) +const unsigned long *link_modes) {return PHY_INTERFACE_MODE_NA ; }
Signature · 1 line
2.30.2
Quoted 36 lines
sfp_select_interface()does not modify itslink_modesargument, so make this a const pointer.Signed-off-by Russell King (Oracle) <[email protected]>--- drivers/net/phy/sfp-bus.c | 2 +- include/linux/sfp.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/net/phy/sfp-bus.c +1
-1@@ -355,7 +355,7 @@ EXPORT_SYMBOL_GPL(sfp_parse_support);* modes mask. */ phy_interface_t sfp_select_interface (struct sfp_bus *bus, -unsigned long *link_modes) +const unsigned long *link_modes) { if (phylink_test(link_modes, 25000baseCR_Full) || phylink_test(link_modes, 25000baseKR_Full) ||include/linux/sfp.h +1
-1@@ -554,7 +554,7 @@ bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id);void sfp_parse_support (struct sfp_bus *bus,const struct sfp_eeprom_id *id,unsigned long *support,unsigned long *interfaces);phy_interface_t sfp_select_interface (struct sfp_bus *bus, -unsigned long *link_modes); +const unsigned long *link_modes);int sfp_get_module_info (struct sfp_bus *bus,struct ethtool_modinfo *modinfo); int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee,
include/linux/sfp.h static inline void sfp_parse_support(struct sfp_bus *bus, · line 596
Quoted 5 lines
include/linux/sfp.h +1
-1@@ -593,7 +593,7 @@ static inline void sfp_parse_support(struct sfp_bus *bus, }static inline phy_interface_t sfp_select_interface (struct sfp_bus *bus, -unsigned long *link_modes) +const unsigned long *link_modes)
There seem to be some misalignment on the opening brace - at least in my editor..
Other than that:
Quoted 7 lines
include/linux/sfp.h +0
-1{return PHY_INTERFACE_MODE_NA ; } --2.30.2
Russell King (Oracle)
maintainerQuoted 9 lines · Daniel Machon
include/linux/sfp.h static inline void sfp_parse_support(struct sfp_bus *bus, · line 596
Quoted 6 lines
include/linux/sfp.h +1
-1@@ -593,7 +593,7 @@ static inline void sfp_parse_support(struct sfp_bus *bus, }static inline phy_interface_t sfp_select_interface (struct sfp_bus *bus, -unsigned long *link_modes) +const unsigned long *link_modes)There seem to be some misalignment on the opening brace - at least in my editor..
It's intentional to avoid going over column 80 (I use an 80 column wide terminal to edit.) It's either that or the thing gets wrapped differently (which then means one loses the return code when grepping.) From a readability point of view, this is what I prefer.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Sun, 28 Apr 2024 15:51:12 +0100 you wrote:
sfp_select_interface()does not modify itslink_modesargument, so make this a const pointer.Signed-off-by Russell King (Oracle) <[email protected]>--- drivers/net/phy/sfp-bus.c | 2 +- include/linux/sfp.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Here is the summary with links:
- [net-next] net: sfp-bus: constify link_modes to sfp_select_interface()
https://git.kernel.org/netdev/net-next/c/5cd9fac3a369
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html