Skip to contentSkip to conversation

net: phy: fixed_phy: shrink size of struct fixed_phy_status

PATCH Applied Heiner Kallweit 2 participants 2 messages Nov 5, 2025 – Nov 8, 2025

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 net: phy: fixed_phy: shrink size of struct fixed_phy_status

All three members are effectively of type bool, so make this explicit and shrink size of struct fixed_phy_status.

---
 drivers/net/phy/fixed_phy.c | 2 +-
 include/linux/phy_fixed.h   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/phy/fixed_phy.c +1 -1
index d498d8a9b..9bd693741 100644
@@ -224,7 +224,7 @@ EXPORT_SYMBOL_GPL(fixed_phy_register);
 struct phy_device *fixed_phy_register_100fd(void)
 {
 	static const struct fixed_phy_status status = {
-		.link	= 1,
+		.link	= true,
 		.speed	= SPEED_100,
 		.duplex	= DUPLEX_FULL,
 	};
include/linux/phy_fixed.h +3 -3
index 8bade9998..436bff20f 100644
@@ -5,11 +5,11 @@
 #include <linux/types.h>
 
 struct fixed_phy_status {
-	int link;
 	int speed;
 	int duplex;
-	int pause;
-	int asym_pause;
+	bool link:1;
+	bool pause:1;
+	bool asym_pause:1;
 };
 
 struct device_node;
Signature · 1 line
2.51.2
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Wed, 5 Nov 2025 23:09:17 +0100 you wrote:

All three members are effectively of type bool, so make this explicit and shrink size of struct fixed_phy_status.

---
 drivers/net/phy/fixed_phy.c | 2 +-
 include/linux/phy_fixed.h   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Here is the summary with links:
- [net-next] net: phy: fixed_phy: shrink size of struct fixed_phy_status

    https://git.kernel.org/netdev/net-next/c/f73e0f46bbfa

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html