aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wilcox <mawilcox@microsoft.com>2018-01-17 10:14:14 -0500
committerThomas Gleixner <tglx@linutronix.de>2018-01-18 05:56:49 -0500
commit05b93801a23c21a6f355f4c492c51715d6ccc96d (patch)
tree7248f379f5954e561db307fb2960fe5fa5429892
parent08f36ff642342fb058212099757cb5d40f158c2a (diff)
lockdep: Convert some users to const
These users of lockdep_is_held() either wanted lockdep_is_held to take a const pointer, or would benefit from providing a const pointer. Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: "David S. Miller" <davem@davemloft.net> Link: https://lkml.kernel.org/r/20180117151414.23686-4-willy@infradead.org
-rw-r--r--include/linux/backing-dev.h2
-rw-r--r--include/linux/srcu.h4
-rw-r--r--include/net/sock.h4
3 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index e54e7e0033eb..3e4ce54d84ab 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -332,7 +332,7 @@ static inline bool inode_to_wb_is_valid(struct inode *inode)
332 * holding either @inode->i_lock, @inode->i_mapping->tree_lock, or the 332 * holding either @inode->i_lock, @inode->i_mapping->tree_lock, or the
333 * associated wb's list_lock. 333 * associated wb's list_lock.
334 */ 334 */
335static inline struct bdi_writeback *inode_to_wb(struct inode *inode) 335static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
336{ 336{
337#ifdef CONFIG_LOCKDEP 337#ifdef CONFIG_LOCKDEP
338 WARN_ON_ONCE(debug_locks && 338 WARN_ON_ONCE(debug_locks &&
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 62be8966e837..33c1c698df09 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -92,7 +92,7 @@ void synchronize_srcu(struct srcu_struct *sp);
92 * relies on normal RCU, it can be called from the CPU which 92 * relies on normal RCU, it can be called from the CPU which
93 * is in the idle loop from an RCU point of view or offline. 93 * is in the idle loop from an RCU point of view or offline.
94 */ 94 */
95static inline int srcu_read_lock_held(struct srcu_struct *sp) 95static inline int srcu_read_lock_held(const struct srcu_struct *sp)
96{ 96{
97 if (!debug_lockdep_rcu_enabled()) 97 if (!debug_lockdep_rcu_enabled())
98 return 1; 98 return 1;
@@ -101,7 +101,7 @@ static inline int srcu_read_lock_held(struct srcu_struct *sp)
101 101
102#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 102#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
103 103
104static inline int srcu_read_lock_held(struct srcu_struct *sp) 104static inline int srcu_read_lock_held(const struct srcu_struct *sp)
105{ 105{
106 return 1; 106 return 1;
107} 107}
diff --git a/include/net/sock.h b/include/net/sock.h
index 7a7b14e9628a..c4a424fe6fdd 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1445,10 +1445,8 @@ do { \
1445} while (0) 1445} while (0)
1446 1446
1447#ifdef CONFIG_LOCKDEP 1447#ifdef CONFIG_LOCKDEP
1448static inline bool lockdep_sock_is_held(const struct sock *csk) 1448static inline bool lockdep_sock_is_held(const struct sock *sk)
1449{ 1449{
1450 struct sock *sk = (struct sock *)csk;
1451
1452 return lockdep_is_held(&sk->sk_lock) || 1450 return lockdep_is_held(&sk->sk_lock) ||
1453 lockdep_is_held(&sk->sk_lock.slock); 1451 lockdep_is_held(&sk->sk_lock.slock);
1454} 1452}