From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756035AbeARLEU (ORCPT ); Thu, 18 Jan 2018 06:04:20 -0500 Received: from terminus.zytor.com ([65.50.211.136]:34849 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755336AbeARLEQ (ORCPT ); Thu, 18 Jan 2018 06:04:16 -0500 Date: Thu, 18 Jan 2018 03:01:43 -0800 From: tip-bot for Matthew Wilcox Message-ID: Cc: peterz@infradead.org, mingo@kernel.org, mawilcox@microsoft.com, davem@davemloft.net, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com Reply-To: davem@davemloft.net, mawilcox@microsoft.com, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, peterz@infradead.org In-Reply-To: <20180117151414.23686-4-willy@infradead.org> References: <20180117151414.23686-4-willy@infradead.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] lockdep: Convert some users to const Git-Commit-ID: 05b93801a23c21a6f355f4c492c51715d6ccc96d X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 05b93801a23c21a6f355f4c492c51715d6ccc96d Gitweb: https://git.kernel.org/tip/05b93801a23c21a6f355f4c492c51715d6ccc96d Author: Matthew Wilcox AuthorDate: Wed, 17 Jan 2018 07:14:14 -0800 Committer: Thomas Gleixner CommitDate: Thu, 18 Jan 2018 11:56:49 +0100 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 Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Cc: "David S. Miller" Link: https://lkml.kernel.org/r/20180117151414.23686-4-willy@infradead.org --- include/linux/backing-dev.h | 2 +- include/linux/srcu.h | 4 ++-- include/net/sock.h | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index e54e7e0..3e4ce54 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) * 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 && diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 62be896..33c1c69 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -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; } diff --git a/include/net/sock.h b/include/net/sock.h index 7a7b14e..c4a424f 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -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); }