diff options
| author | Dr. David Alan Gilbert <linux@treblig.org> | 2025-01-22 01:25:59 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-04 14:38:42 +0100 |
| commit | 42e128c9d5c5b6632c3b182afb7fab0957b6c337 (patch) | |
| tree | 808569bf27e86155e21dccb55280d3683f71fd6e /drivers/tty/tty_ldsem.c | |
| parent | f0c8814c1c24999aaff2f04b5bdb1d0da2b6a030 (diff) | |
tty/ldsem: Remove unused ldsem_down_write_trylock
ldsem_down_write_trylock() was added in 2013 by
commit 4898e640caf0 ("tty: Add timed, writer-prioritized rw semaphore")
but hasn't been used.
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250122012559.441006-1-linux@treblig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_ldsem.c')
| -rw-r--r-- | drivers/tty/tty_ldsem.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/drivers/tty/tty_ldsem.c b/drivers/tty/tty_ldsem.c index 3be428c16260..4e18031a5ca3 100644 --- a/drivers/tty/tty_ldsem.c +++ b/drivers/tty/tty_ldsem.c @@ -367,23 +367,6 @@ int __sched ldsem_down_write(struct ld_semaphore *sem, long timeout) } /* - * trylock for writing -- returns 1 if successful, 0 if contention - */ -int ldsem_down_write_trylock(struct ld_semaphore *sem) -{ - long count = atomic_long_read(&sem->count); - - while ((count & LDSEM_ACTIVE_MASK) == 0) { - if (atomic_long_try_cmpxchg(&sem->count, &count, count + LDSEM_WRITE_BIAS)) { - rwsem_acquire(&sem->dep_map, 0, 1, _RET_IP_); - lock_acquired(&sem->dep_map, _RET_IP_); - return 1; - } - } - return 0; -} - -/* * release a read lock */ void ldsem_up_read(struct ld_semaphore *sem) |
