Commit 5902ee6
iavf: simplify mutex_trylock+sleep loops
This pattern appears in two places in the iavf source code:
while (!mutex_trylock(...))
usleep_range(...);
That's just mutex_lock with extra steps.
The pattern is a leftover from when iavf used bit flags instead of
mutexes for locking. Commit 5ac49f3 ("iavf: use mutexes for locking
of critical sections") replaced test_and_set_bit with !mutex_trylock,
preserving the pattern.
Simplify it to mutex_lock.
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231027175941.1340255-3-jacob.e.keller@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 77361cb commit 5902ee6
1 file changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3011 | 3011 | | |
3012 | 3012 | | |
3013 | 3013 | | |
3014 | | - | |
3015 | | - | |
| 3014 | + | |
3016 | 3015 | | |
3017 | 3016 | | |
3018 | 3017 | | |
| |||
5065 | 5064 | | |
5066 | 5065 | | |
5067 | 5066 | | |
5068 | | - | |
5069 | | - | |
| 5067 | + | |
5070 | 5068 | | |
5071 | 5069 | | |
5072 | 5070 | | |
| |||
0 commit comments