* [PATCH net-next 0/3] Constify a few sfp/phy fwnodes
@ 2023-03-24 9:19 Russell King (Oracle)
2023-03-24 9:22 ` Russell King (Oracle)
2023-03-24 9:23 ` [PATCH RESEND " Russell King (Oracle)
0 siblings, 2 replies; 11+ messages in thread
From: Russell King (Oracle) @ 2023-03-24 9:19 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, netdev, Paolo Abeni
Hi,
This series constifies a bunch of fwnode_handle pointers that are only
used to refer to but not modify the contents of the fwnode structures.
drivers/net/phy/phy_device.c | 2 +-
drivers/net/phy/sfp-bus.c | 6 +++---
include/linux/phy.h | 2 +-
include/linux/sfp.h | 5 +++--
4 files changed, 8 insertions(+), 7 deletions(-)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 0/3] Constify a few sfp/phy fwnodes
2023-03-24 9:19 [PATCH net-next 0/3] Constify a few sfp/phy fwnodes Russell King (Oracle)
@ 2023-03-24 9:22 ` Russell King (Oracle)
2023-03-24 9:23 ` [PATCH RESEND " Russell King (Oracle)
1 sibling, 0 replies; 11+ messages in thread
From: Russell King (Oracle) @ 2023-03-24 9:22 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, netdev, Paolo Abeni
Oops, I typo'd one of the addresses when sending the series. I'll
re-send. Please ignore this posting.
On Fri, Mar 24, 2023 at 09:19:48AM +0000, Russell King (Oracle) wrote:
> Hi,
>
> This series constifies a bunch of fwnode_handle pointers that are only
> used to refer to but not modify the contents of the fwnode structures.
>
> drivers/net/phy/phy_device.c | 2 +-
> drivers/net/phy/sfp-bus.c | 6 +++---
> include/linux/phy.h | 2 +-
> include/linux/sfp.h | 5 +++--
> 4 files changed, 8 insertions(+), 7 deletions(-)
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
>
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH RESEND net-next 0/3] Constify a few sfp/phy fwnodes
2023-03-24 9:19 [PATCH net-next 0/3] Constify a few sfp/phy fwnodes Russell King (Oracle)
2023-03-24 9:22 ` Russell King (Oracle)
@ 2023-03-24 9:23 ` Russell King (Oracle)
2023-03-24 9:23 ` [PATCH net-next 1/3] net: sfp: make sfp_bus_find_fwnode() take a const fwnode Russell King (Oracle)
` (3 more replies)
1 sibling, 4 replies; 11+ messages in thread
From: Russell King (Oracle) @ 2023-03-24 9:23 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, netdev, Paolo Abeni
Hi,
This series constifies a bunch of fwnode_handle pointers that are only
used to refer to but not modify the contents of the fwnode structures.
drivers/net/phy/phy_device.c | 2 +-
drivers/net/phy/sfp-bus.c | 6 +++---
include/linux/phy.h | 2 +-
include/linux/sfp.h | 5 +++--
4 files changed, 8 insertions(+), 7 deletions(-)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net-next 1/3] net: sfp: make sfp_bus_find_fwnode() take a const fwnode
2023-03-24 9:23 ` [PATCH RESEND " Russell King (Oracle)
@ 2023-03-24 9:23 ` Russell King (Oracle)
2023-03-24 20:50 ` Simon Horman
2023-03-24 9:23 ` [PATCH net-next 2/3] net: sfp: constify sfp-bus internal fwnode uses Russell King (Oracle)
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Russell King (Oracle) @ 2023-03-24 9:23 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, netdev, Paolo Abeni
sfp_bus_find_fwnode() does not write to the fwnode, so let's make it
const.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/phy/sfp-bus.c | 2 +-
include/linux/sfp.h | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index 1dd50f2ca05d..b4680f859269 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -593,7 +593,7 @@ static void sfp_upstream_clear(struct sfp_bus *bus)
* - %-ENOMEM if we failed to allocate the bus.
* - an error from the upstream's connect_phy() method.
*/
-struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
+struct sfp_bus *sfp_bus_find_fwnode(const struct fwnode_handle *fwnode)
{
struct fwnode_reference_args ref;
struct sfp_bus *bus;
diff --git a/include/linux/sfp.h b/include/linux/sfp.h
index 52b98f9666a2..ef06a195b3c2 100644
--- a/include/linux/sfp.h
+++ b/include/linux/sfp.h
@@ -557,7 +557,7 @@ int sfp_get_module_eeprom_by_page(struct sfp_bus *bus,
void sfp_upstream_start(struct sfp_bus *bus);
void sfp_upstream_stop(struct sfp_bus *bus);
void sfp_bus_put(struct sfp_bus *bus);
-struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode);
+struct sfp_bus *sfp_bus_find_fwnode(const struct fwnode_handle *fwnode);
int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
const struct sfp_upstream_ops *ops);
void sfp_bus_del_upstream(struct sfp_bus *bus);
@@ -619,7 +619,8 @@ static inline void sfp_bus_put(struct sfp_bus *bus)
{
}
-static inline struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
+static inline struct sfp_bus *
+sfp_bus_find_fwnode(const struct fwnode_handle *fwnode)
{
return NULL;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net-next 2/3] net: sfp: constify sfp-bus internal fwnode uses
2023-03-24 9:23 ` [PATCH RESEND " Russell King (Oracle)
2023-03-24 9:23 ` [PATCH net-next 1/3] net: sfp: make sfp_bus_find_fwnode() take a const fwnode Russell King (Oracle)
@ 2023-03-24 9:23 ` Russell King (Oracle)
2023-03-24 20:51 ` Simon Horman
2023-03-24 9:23 ` [PATCH net-next 3/3] net: phy: constify fwnode_get_phy_node() fwnode argument Russell King (Oracle)
2023-03-27 7:20 ` [PATCH RESEND net-next 0/3] Constify a few sfp/phy fwnodes patchwork-bot+netdevbpf
3 siblings, 1 reply; 11+ messages in thread
From: Russell King (Oracle) @ 2023-03-24 9:23 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, netdev, Paolo Abeni
Constify sfp-bus internal fwnode uses, since we do not modify the
fwnode structures.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/phy/sfp-bus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index b4680f859269..9372e5a4cadc 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -17,7 +17,7 @@ struct sfp_bus {
/* private: */
struct kref kref;
struct list_head node;
- struct fwnode_handle *fwnode;
+ const struct fwnode_handle *fwnode;
const struct sfp_socket_ops *socket_ops;
struct device *sfp_dev;
@@ -390,7 +390,7 @@ static const struct sfp_upstream_ops *sfp_get_upstream_ops(struct sfp_bus *bus)
return bus->registered ? bus->upstream_ops : NULL;
}
-static struct sfp_bus *sfp_bus_get(struct fwnode_handle *fwnode)
+static struct sfp_bus *sfp_bus_get(const struct fwnode_handle *fwnode)
{
struct sfp_bus *sfp, *new, *found = NULL;
--
2.30.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net-next 3/3] net: phy: constify fwnode_get_phy_node() fwnode argument
2023-03-24 9:23 ` [PATCH RESEND " Russell King (Oracle)
2023-03-24 9:23 ` [PATCH net-next 1/3] net: sfp: make sfp_bus_find_fwnode() take a const fwnode Russell King (Oracle)
2023-03-24 9:23 ` [PATCH net-next 2/3] net: sfp: constify sfp-bus internal fwnode uses Russell King (Oracle)
@ 2023-03-24 9:23 ` Russell King (Oracle)
2023-03-24 20:51 ` Simon Horman
2023-03-27 7:20 ` [PATCH RESEND net-next 0/3] Constify a few sfp/phy fwnodes patchwork-bot+netdevbpf
3 siblings, 1 reply; 11+ messages in thread
From: Russell King (Oracle) @ 2023-03-24 9:23 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, netdev, Paolo Abeni
fwnode_get_phy_node() does not motify the fwnode structure, so make
the argument const,
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/phy/phy_device.c | 2 +-
include/linux/phy.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index c0760cbf534b..917ba84105fc 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -3057,7 +3057,7 @@ EXPORT_SYMBOL_GPL(device_phy_find_device);
* and "phy-device" are not supported in ACPI. DT supports all the three
* named references to the phy node.
*/
-struct fwnode_handle *fwnode_get_phy_node(struct fwnode_handle *fwnode)
+struct fwnode_handle *fwnode_get_phy_node(const struct fwnode_handle *fwnode)
{
struct fwnode_handle *phy_node;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index fefd5091bc24..2f83cfc206e5 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1546,7 +1546,7 @@ int fwnode_get_phy_id(struct fwnode_handle *fwnode, u32 *phy_id);
struct mdio_device *fwnode_mdio_find_device(struct fwnode_handle *fwnode);
struct phy_device *fwnode_phy_find_device(struct fwnode_handle *phy_fwnode);
struct phy_device *device_phy_find_device(struct device *dev);
-struct fwnode_handle *fwnode_get_phy_node(struct fwnode_handle *fwnode);
+struct fwnode_handle *fwnode_get_phy_node(const struct fwnode_handle *fwnode);
struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
int phy_device_register(struct phy_device *phy);
void phy_device_free(struct phy_device *phydev);
--
2.30.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 1/3] net: sfp: make sfp_bus_find_fwnode() take a const fwnode
2023-03-24 9:23 ` [PATCH net-next 1/3] net: sfp: make sfp_bus_find_fwnode() take a const fwnode Russell King (Oracle)
@ 2023-03-24 20:50 ` Simon Horman
0 siblings, 0 replies; 11+ messages in thread
From: Simon Horman @ 2023-03-24 20:50 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
Jakub Kicinski, netdev, Paolo Abeni
On Fri, Mar 24, 2023 at 09:23:42AM +0000, Russell King (Oracle) wrote:
> sfp_bus_find_fwnode() does not write to the fwnode, so let's make it
> const.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 2/3] net: sfp: constify sfp-bus internal fwnode uses
2023-03-24 9:23 ` [PATCH net-next 2/3] net: sfp: constify sfp-bus internal fwnode uses Russell King (Oracle)
@ 2023-03-24 20:51 ` Simon Horman
0 siblings, 0 replies; 11+ messages in thread
From: Simon Horman @ 2023-03-24 20:51 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
Jakub Kicinski, netdev, Paolo Abeni
On Fri, Mar 24, 2023 at 09:23:48AM +0000, Russell King (Oracle) wrote:
> Constify sfp-bus internal fwnode uses, since we do not modify the
> fwnode structures.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 3/3] net: phy: constify fwnode_get_phy_node() fwnode argument
2023-03-24 9:23 ` [PATCH net-next 3/3] net: phy: constify fwnode_get_phy_node() fwnode argument Russell King (Oracle)
@ 2023-03-24 20:51 ` Simon Horman
0 siblings, 0 replies; 11+ messages in thread
From: Simon Horman @ 2023-03-24 20:51 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
Jakub Kicinski, netdev, Paolo Abeni
On Fri, Mar 24, 2023 at 09:23:53AM +0000, Russell King (Oracle) wrote:
> fwnode_get_phy_node() does not motify the fwnode structure, so make
> the argument const,
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RESEND net-next 0/3] Constify a few sfp/phy fwnodes
2023-03-24 9:23 ` [PATCH RESEND " Russell King (Oracle)
` (2 preceding siblings ...)
2023-03-24 9:23 ` [PATCH net-next 3/3] net: phy: constify fwnode_get_phy_node() fwnode argument Russell King (Oracle)
@ 2023-03-27 7:20 ` patchwork-bot+netdevbpf
2023-03-27 8:22 ` Russell King (Oracle)
3 siblings, 1 reply; 11+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-27 7:20 UTC (permalink / raw)
To: Russell King; +Cc: andrew, hkallweit1, davem, edumazet, kuba, netdev, pabeni
Hello:
This series was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:
On Fri, 24 Mar 2023 09:23:17 +0000 you wrote:
> Hi,
>
> This series constifies a bunch of fwnode_handle pointers that are only
> used to refer to but not modify the contents of the fwnode structures.
>
> drivers/net/phy/phy_device.c | 2 +-
> drivers/net/phy/sfp-bus.c | 6 +++---
> include/linux/phy.h | 2 +-
> include/linux/sfp.h | 5 +++--
> 4 files changed, 8 insertions(+), 7 deletions(-)
Here is the summary with links:
- [net-next,1/3] net: sfp: make sfp_bus_find_fwnode() take a const fwnode
https://git.kernel.org/netdev/net/c/a90ac762d345
- [net-next,2/3] net: sfp: constify sfp-bus internal fwnode uses
https://git.kernel.org/netdev/net/c/850a8d2dc712
- [net-next,3/3] net: phy: constify fwnode_get_phy_node() fwnode argument
https://git.kernel.org/netdev/net/c/4a0faa02d419
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] 11+ messages in thread
* Re: [PATCH RESEND net-next 0/3] Constify a few sfp/phy fwnodes
2023-03-27 7:20 ` [PATCH RESEND net-next 0/3] Constify a few sfp/phy fwnodes patchwork-bot+netdevbpf
@ 2023-03-27 8:22 ` Russell King (Oracle)
0 siblings, 0 replies; 11+ messages in thread
From: Russell King (Oracle) @ 2023-03-27 8:22 UTC (permalink / raw)
To: davem; +Cc: andrew, hkallweit1, edumazet, kuba, netdev, pabeni
Hi David,
I notice you merged this to the net tree rather than the net-next tree
which was in the subject tag. Was there a reason for applying it to
the net tree?
Thanks.
On Mon, Mar 27, 2023 at 07:20:18AM +0000, patchwork-bot+netdevbpf@kernel.org wrote:
> Hello:
>
> This series was applied to netdev/net.git (main)
> by David S. Miller <davem@davemloft.net>:
>
> On Fri, 24 Mar 2023 09:23:17 +0000 you wrote:
> > Hi,
> >
> > This series constifies a bunch of fwnode_handle pointers that are only
> > used to refer to but not modify the contents of the fwnode structures.
> >
> > drivers/net/phy/phy_device.c | 2 +-
> > drivers/net/phy/sfp-bus.c | 6 +++---
> > include/linux/phy.h | 2 +-
> > include/linux/sfp.h | 5 +++--
> > 4 files changed, 8 insertions(+), 7 deletions(-)
>
> Here is the summary with links:
> - [net-next,1/3] net: sfp: make sfp_bus_find_fwnode() take a const fwnode
> https://git.kernel.org/netdev/net/c/a90ac762d345
> - [net-next,2/3] net: sfp: constify sfp-bus internal fwnode uses
> https://git.kernel.org/netdev/net/c/850a8d2dc712
> - [net-next,3/3] net: phy: constify fwnode_get_phy_node() fwnode argument
> https://git.kernel.org/netdev/net/c/4a0faa02d419
>
> You are awesome, thank you!
> --
> Deet-doot-dot, I am a bot.
> https://korg.docs.kernel.org/patchwork/pwbot.html
>
>
>
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-03-27 8:22 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 9:19 [PATCH net-next 0/3] Constify a few sfp/phy fwnodes Russell King (Oracle)
2023-03-24 9:22 ` Russell King (Oracle)
2023-03-24 9:23 ` [PATCH RESEND " Russell King (Oracle)
2023-03-24 9:23 ` [PATCH net-next 1/3] net: sfp: make sfp_bus_find_fwnode() take a const fwnode Russell King (Oracle)
2023-03-24 20:50 ` Simon Horman
2023-03-24 9:23 ` [PATCH net-next 2/3] net: sfp: constify sfp-bus internal fwnode uses Russell King (Oracle)
2023-03-24 20:51 ` Simon Horman
2023-03-24 9:23 ` [PATCH net-next 3/3] net: phy: constify fwnode_get_phy_node() fwnode argument Russell King (Oracle)
2023-03-24 20:51 ` Simon Horman
2023-03-27 7:20 ` [PATCH RESEND net-next 0/3] Constify a few sfp/phy fwnodes patchwork-bot+netdevbpf
2023-03-27 8:22 ` Russell King (Oracle)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.