]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
lockdep: Convert some users to const
authorMatthew Wilcox <mawilcox@microsoft.com>
Wed, 17 Jan 2018 15:14:14 +0000 (07:14 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 18 Jan 2018 10:56:49 +0000 (11:56 +0100)
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
include/linux/backing-dev.h
include/linux/srcu.h
include/net/sock.h

index e54e7e0033eb3c3fd97700a51e44225bd083551a..3e4ce54d84ab2f50293a6f11dbe5d10ce17989d3 100644 (file)
@@ -332,7 +332,7 @@ static inline bool inode_to_wb_is_valid(struct inode *inode)
  * holding either @inode->i_lock, @inode->i_mapping->tree_lock, or the
  * associated wb's list_lock.
  */
-static inline struct bdi_writeback *inode_to_wb(struct inode *inode)
+static inline struct bdi_writeback *inode_to_wb(const struct inode *inode)
 {
 #ifdef CONFIG_LOCKDEP
        WARN_ON_ONCE(debug_locks &&
index 62be8966e8370535ac6cb9b15b7c154e23381dda..33c1c698df093aa98640c3abb4f2b46f2a9c6de8 100644 (file)
@@ -92,7 +92,7 @@ void synchronize_srcu(struct srcu_struct *sp);
  * relies on normal RCU, it can be called from the CPU which
  * is in the idle loop from an RCU point of view or offline.
  */
-static inline int srcu_read_lock_held(struct srcu_struct *sp)
+static inline int srcu_read_lock_held(const struct srcu_struct *sp)
 {
        if (!debug_lockdep_rcu_enabled())
                return 1;
@@ -101,7 +101,7 @@ static inline int srcu_read_lock_held(struct srcu_struct *sp)
 
 #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
 
-static inline int srcu_read_lock_held(struct srcu_struct *sp)
+static inline int srcu_read_lock_held(const struct srcu_struct *sp)
 {
        return 1;
 }
index 7a7b14e9628a1174e18dda30cd0b5bfd5b32d30d..c4a424fe6fdd83f85dd2b1cfd10f6a69d69d6f8f 100644 (file)
@@ -1445,10 +1445,8 @@ do {                                                                     \
 } while (0)
 
 #ifdef CONFIG_LOCKDEP
-static inline bool lockdep_sock_is_held(const struct sock *csk)
+static inline bool lockdep_sock_is_held(const struct sock *sk)
 {
-       struct sock *sk = (struct sock *)csk;
-
        return lockdep_is_held(&sk->sk_lock) ||
               lockdep_is_held(&sk->sk_lock.slock);
 }