[<prev] [next>] [day] [month] [year] [list]
Message-ID: <15670760.jIsrciUiTQ@mobilepool36.emlix.com>
Date: Thu, 17 Feb 2022 09:15:33 +0100
From: Rolf Eike Beer <eb@...ix.com>
To: Peter Zijlstra <peterz@...radead.org>,
Boqun Feng <boqun.feng@...il.com>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] 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 <eb@...ix.com>
---
include/linux/rwsem.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index f9348769e558..f62fa3ec95de 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -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
--
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
Powered by blists - more mailing lists