mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] lock/rwlock fix comment for rwlock
@ 2017-11-03 10:59 Cheng Jian
  2017-11-07 11:34 ` [tip:locking/core] locking/rwlocks: Fix comments tip-bot for Cheng Jian
  0 siblings, 1 reply; 2+ messages in thread
From: Cheng Jian @ 2017-11-03 10:59 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel, xiexiuqi, huawei.libin

The kernel/locking/spinlock.c file contains the
implementations of spinlock and rwlock.
and __lock_function inlines are taken from other include
files. the comment miss rwlock_api_smp.h about rwlock.

also fix a little comment in rwlock_api_smp.h

Signed-off-by: Cheng Jian <cj.chengjian@huawei.com>
---
 include/linux/rwlock_api_smp.h | 2 +-
 kernel/locking/spinlock.c      | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/rwlock_api_smp.h b/include/linux/rwlock_api_smp.h
index 5b9b84b..86ebb4b 100644
--- a/include/linux/rwlock_api_smp.h
+++ b/include/linux/rwlock_api_smp.h
@@ -211,7 +211,7 @@ static inline void __raw_write_lock(rwlock_t *lock)
 	LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock);
 }
 
-#endif /* CONFIG_PREEMPT */
+#endif /* !CONFIG_GENERIC_LOCKBREAK || CONFIG_DEBUG_LOCK_ALLOC */
 
 static inline void __raw_write_unlock(rwlock_t *lock)
 {
diff --git a/kernel/locking/spinlock.c b/kernel/locking/spinlock.c
index 6e40fdf..11fbca7 100644
--- a/kernel/locking/spinlock.c
+++ b/kernel/locking/spinlock.c
@@ -30,7 +30,8 @@
 #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC)
 /*
  * The __lock_function inlines are taken from
- * include/linux/spinlock_api_smp.h
+ * spinlock : include/linux/spinlock_api_smp.h
+ * rwlock   : include/linux/rwlock_api_smp.h
  */
 #else
 #define raw_read_can_lock(l)	read_can_lock(l)
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:locking/core] locking/rwlocks: Fix comments
  2017-11-03 10:59 [PATCH] lock/rwlock fix comment for rwlock Cheng Jian
@ 2017-11-07 11:34 ` tip-bot for Cheng Jian
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Cheng Jian @ 2017-11-07 11:34 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, hpa, peterz, mingo, torvalds, linux-kernel, cj.chengjian

Commit-ID:  f791dd2589d7e217625d7e411621a5bac71cbf69
Gitweb:     https://git.kernel.org/tip/f791dd2589d7e217625d7e411621a5bac71cbf69
Author:     Cheng Jian <cj.chengjian@huawei.com>
AuthorDate: Fri, 3 Nov 2017 18:59:48 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 7 Nov 2017 12:22:21 +0100

locking/rwlocks: Fix comments

- fix the list of locking API headers in kernel/locking/spinlock.c
- fix an #endif comment

Signed-off-by: Cheng Jian <cj.chengjian@huawei.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: huawei.libin@huawei.com
Cc: xiexiuqi@huawei.com
Link: http://lkml.kernel.org/r/1509706788-152547-1-git-send-email-cj.chengjian@huawei.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/linux/rwlock_api_smp.h | 2 +-
 kernel/locking/spinlock.c      | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/rwlock_api_smp.h b/include/linux/rwlock_api_smp.h
index 5b9b84b..86ebb4b 100644
--- a/include/linux/rwlock_api_smp.h
+++ b/include/linux/rwlock_api_smp.h
@@ -211,7 +211,7 @@ static inline void __raw_write_lock(rwlock_t *lock)
 	LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock);
 }
 
-#endif /* CONFIG_PREEMPT */
+#endif /* !CONFIG_GENERIC_LOCKBREAK || CONFIG_DEBUG_LOCK_ALLOC */
 
 static inline void __raw_write_unlock(rwlock_t *lock)
 {
diff --git a/kernel/locking/spinlock.c b/kernel/locking/spinlock.c
index b963433..1fd1a75 100644
--- a/kernel/locking/spinlock.c
+++ b/kernel/locking/spinlock.c
@@ -30,7 +30,8 @@
 #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC)
 /*
  * The __lock_function inlines are taken from
- * include/linux/spinlock_api_smp.h
+ * spinlock : include/linux/spinlock_api_smp.h
+ * rwlock   : include/linux/rwlock_api_smp.h
  */
 #else
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-07 11:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03 10:59 [PATCH] lock/rwlock fix comment for rwlock Cheng Jian
2017-11-07 11:34 ` [tip:locking/core] locking/rwlocks: Fix comments tip-bot for Cheng Jian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®