[PATCH] locking/lockdep: Remove unnecessary DEBUG_LOCKS_WARN_ON()

Will Deacon will.deacon at arm.com
Wed Jun 5 05:46:33 PDT 2019


On Thu, May 30, 2019 at 07:59:35PM +0800, Kobe Wu wrote:
> DEBUG_LOCKS_WARN_ON() will turn off debug_locks and 
> makes print_unlock_imbalance_bug() return directly.
> 
> Remove a redundant whitespace.
> 
> Signed-off-by: Kobe Wu <kobe-cp.wu at mediatek.com>
> ---
>  kernel/locking/lockdep.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index d06190f..37c0a5e 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -4049,8 +4049,8 @@ static int __lock_downgrade(struct lockdep_map *lock, unsigned long ip)
>  	 * So we're all set to release this lock.. wait what lock? We don't
>  	 * own any locks, you've been drinking again?
>  	 */
> -	if (DEBUG_LOCKS_WARN_ON(depth <= 0))
> -		 return print_unlock_imbalance_bug(curr, lock, ip);
> +	if (depth <= 0)
> +		return print_unlock_imbalance_bug(curr, lock, ip);

Hmm, feels more like we should keep the DEBUG_LOCKS_WARN_ON but just
return 0 when it fires.

Peter?

Will



More information about the Linux-mediatek mailing list