History

net: phy: don't use locking in phy_is_started

Russell suggested to remove the locking from phy_is_started() because the read is atomic anyway and actually the locking may be more misleading.

Heiner Kallweit committed 7 years ago

Commit a2fc9d71 parent 39c13312 files · +6 −20Browse files

Showing the changes to include (1 of 2 files). Show all

Unified · Split

include/linux/phy.h+1−14
@@ -674,26 +674,13 @@ phy_lookup_setting(int speed, int duplex, const unsigned long *mask, · 673 unmodified lines
674674 size_t phy_speeds(unsigned int *speeds, size_t size,
675675 unsigned long *mask);
676676
677−static inline bool __phy_is_started(struct phy_device *phydev)
678−{
679− WARN_ON(!mutex_is_locked(&phydev->lock));
680−
681− return phydev->state >= PHY_UP;
682−}
683−
684677 /**
685678 * phy_is_started - Convenience function to check whether PHY is started
686679 * @phydev: The phy_device struct
687680 */
688681 static inline bool phy_is_started(struct phy_device *phydev)
689682 {
690− bool started;
691−
692− mutex_lock(&phydev->lock);
693− started = __phy_is_started(phydev);
694− mutex_unlock(&phydev->lock);
695−
696− return started;
683+ return phydev->state >= PHY_UP;
697684 }
698685
699686 void phy_resolve_aneg_linkmode(struct phy_device *phydev);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t