Skip to contentSkip to conversation

net: usb: lan78xx: constify fphy_status

PATCH In review Heiner Kallweit 3 participants 3 messages May 23, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: usb: lan78xx: constify fphy_status

Constify variable fphy_status.

---
 drivers/net/usb/lan78xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/lan78xx.c +1 -1
index 759dab980..17c23eada 100644
@@ -2630,7 +2630,7 @@ static int lan78xx_configure_flowcontrol(struct lan78xx_net *dev,
  */
 static struct phy_device *lan78xx_register_fixed_phy(struct lan78xx_net *dev)
 {
-	struct fixed_phy_status fphy_status = {
+	static const struct fixed_phy_status fphy_status = {
 		.link = 1,
 		.speed = SPEED_1000,
 		.duplex = DUPLEX_FULL,
Signature · 1 line
2.49.0
#2 lore raw
In reply to Heiner Kallweit
Quoted 12 lines · Heiner Kallweit

Constify variable fphy_status.

---
  drivers/net/usb/lan78xx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/lan78xx.c +0 -0
index 759dab980..17c23eada 100644

drivers/net/usb/lan78xx.c static int lan78xx_configure_flowcontrol(struct lan78xx_net *dev, · line 2633

Quoted 5 lines
drivers/net/usb/lan78xx.c +1 -1
@@ -2630,7 +2630,7 @@ static int lan78xx_configure_flowcontrol(struct lan78xx_net *dev,
   */
  static struct phy_device *lan78xx_register_fixed_phy(struct lan78xx_net *dev)
  {
-	struct fixed_phy_status fphy_status = {
+	static const struct fixed_phy_status fphy_status = {

You are also making this static, but that's not detailed in the commit message.

Signature · 1 line
Florian