locking/rwsem: mark down_(read|write)_trylock() as __must_check
PATCH 1/1 locking/rwsem: mark down_(read|write)_trylock() as __must_check
When you don't look at the return code you can't know if you actually got the lock.
Signed-off-by Rolf Eike Beer <[email protected]>
--- include/linux/rwsem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/rwsem.h +2 -2
@@ -178,7 +178,7 @@ extern int __must_check down_read_killable(struct rw_semaphore *sem);/* * trylock for reading -- returns 1 if successful, 0 if contention */ -extern int down_read_trylock (struct rw_semaphore *sem); +extern int __must_check down_read_trylock (struct rw_semaphore *sem);/* * lock for writing
@@ -189,7 +189,7 @@ extern int __must_check down_write_killable(struct rw_semaphore *sem);/* * trylock for writing -- returns 1 if successful, 0 if contention */ -extern int down_write_trylock (struct rw_semaphore *sem); +extern int __must_check down_write_trylock (struct rw_semaphore *sem);/* * release a read lock
Signature · 10 lines
2.35.1 -- Rolf Eike Beer, emlix GmbH, https://www.emlix.com Fon +49 551 30664-0, Fax +49 551 30664-11 Gothaer Platz 3, 37083 Göttingen, Germany Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160 Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055 emlix - smart embedded open source