netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: sfp-bus: constify link_modes to sfp_select_interface()
@ 2024-04-28 14:51 Russell King (Oracle)
  2024-04-29  8:25 ` Daniel Machon
  2024-04-30 13:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2024-04-28 14:51 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev

sfp_select_interface() does not modify its link_modes argument, so
make this a const pointer.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/sfp-bus.c | 2 +-
 include/linux/sfp.h       | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index c6e3baf00f23..37c85f1e6534 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -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) ||
diff --git a/include/linux/sfp.h b/include/linux/sfp.h
index 55c0ab17c9e2..5ebc57f78c95 100644
--- a/include/linux/sfp.h
+++ b/include/linux/sfp.h
@@ -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;
 }
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: sfp-bus: constify link_modes to sfp_select_interface()
  2024-04-28 14:51 [PATCH net-next] net: sfp-bus: constify link_modes to sfp_select_interface() Russell King (Oracle)
@ 2024-04-29  8:25 ` Daniel Machon
  2024-04-29  8:58   ` Russell King (Oracle)
  2024-04-30 13:40 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Machon @ 2024-04-29  8:25 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev

> sfp_select_interface() does not modify its link_modes argument, so
> make this a const pointer.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  drivers/net/phy/sfp-bus.c | 2 +-
>  include/linux/sfp.h       | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
> index c6e3baf00f23..37c85f1e6534 100644
> --- a/drivers/net/phy/sfp-bus.c
> +++ b/drivers/net/phy/sfp-bus.c
> @@ -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) ||
> diff --git a/include/linux/sfp.h b/include/linux/sfp.h
> index 55c0ab17c9e2..5ebc57f78c95 100644
> --- a/include/linux/sfp.h
> +++ b/include/linux/sfp.h
> @@ -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)

There seem to be some misalignment on the opening brace - at least in my
editor..

Other than that:

Reviewed-by: Daniel Machon <daniel.machon@microchip.com>


>  {
>         return PHY_INTERFACE_MODE_NA;
>  }
> --
> 2.30.2
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: sfp-bus: constify link_modes to sfp_select_interface()
  2024-04-29  8:25 ` Daniel Machon
@ 2024-04-29  8:58   ` Russell King (Oracle)
  0 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2024-04-29  8:58 UTC (permalink / raw)
  To: Daniel Machon
  Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev

On Mon, Apr 29, 2024 at 08:25:11AM +0000, Daniel Machon wrote:
> > @@ -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.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: sfp-bus: constify link_modes to sfp_select_interface()
  2024-04-28 14:51 [PATCH net-next] net: sfp-bus: constify link_modes to sfp_select_interface() Russell King (Oracle)
  2024-04-29  8:25 ` Daniel Machon
@ 2024-04-30 13:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-30 13:40 UTC (permalink / raw)
  To: Russell King; +Cc: andrew, hkallweit1, davem, edumazet, kuba, pabeni, netdev

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Sun, 28 Apr 2024 15:51:12 +0100 you wrote:
> sfp_select_interface() does not modify its link_modes argument, so
> make this a const pointer.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-30 13:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-28 14:51 [PATCH net-next] net: sfp-bus: constify link_modes to sfp_select_interface() Russell King (Oracle)
2024-04-29  8:25 ` Daniel Machon
2024-04-29  8:58   ` Russell King (Oracle)
2024-04-30 13:40 ` patchwork-bot+netdevbpf

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).