Skip to content

Commit 87e5808

Browse files
hkallweitdavem330
authored andcommitted
net: phy: replace bool members in struct phy_device with bit-fields
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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5c35242 commit 87e5808

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

include/linux/phy.h

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,17 @@ struct phy_device {
406406
u32 phy_id;
407407

408408
struct phy_c45_device_ids c45_ids;
409-
bool is_c45;
410-
bool is_internal;
411-
bool is_pseudo_fixed_link;
412-
bool has_fixups;
413-
bool suspended;
414-
bool sysfs_links;
415-
bool loopback_enabled;
409+
unsigned is_c45:1;
410+
unsigned is_internal:1;
411+
unsigned is_pseudo_fixed_link:1;
412+
unsigned has_fixups:1;
413+
unsigned suspended:1;
414+
unsigned sysfs_links:1;
415+
unsigned loopback_enabled:1;
416+
417+
unsigned autoneg:1;
418+
/* The most recently read link state */
419+
unsigned link:1;
416420

417421
enum phy_state state;
418422

@@ -429,9 +433,6 @@ struct phy_device {
429433
int pause;
430434
int asym_pause;
431435

432-
/* The most recently read link state */
433-
int link;
434-
435436
/* Enabled Interrupts */
436437
u32 interrupts;
437438

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

447-
int autoneg;
448-
449448
int link_timeout;
450449

451450
#ifdef CONFIG_LED_TRIGGER_PHY

0 commit comments

Comments
 (0)