Skip to content

Commit

Permalink
net: phy: replace bool members in struct phy_device with bit-fields
Browse files Browse the repository at this point in the history
In struct phy_device we have a number of flags being defined as type
bool. Similar to e.g. struct pci_dev we can save some space by using
bit-fields.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed May 24, 2018
1 parent 5c35242 commit 87e5808
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions include/linux/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,17 @@ struct phy_device {
u32 phy_id;

struct phy_c45_device_ids c45_ids;
bool is_c45;
bool is_internal;
bool is_pseudo_fixed_link;
bool has_fixups;
bool suspended;
bool sysfs_links;
bool loopback_enabled;
unsigned is_c45:1;
unsigned is_internal:1;
unsigned is_pseudo_fixed_link:1;
unsigned has_fixups:1;
unsigned suspended:1;
unsigned sysfs_links:1;
unsigned loopback_enabled:1;

unsigned autoneg:1;
/* The most recently read link state */
unsigned link:1;

enum phy_state state;

Expand All @@ -429,9 +433,6 @@ struct phy_device {
int pause;
int asym_pause;

/* The most recently read link state */
int link;

/* Enabled Interrupts */
u32 interrupts;

Expand All @@ -444,8 +445,6 @@ struct phy_device {
/* Energy efficient ethernet modes which should be prohibited */
u32 eee_broken_modes;

int autoneg;

int link_timeout;

#ifdef CONFIG_LED_TRIGGER_PHY
Expand Down

0 comments on commit 87e5808

Please sign in to comment.