From 3b11319177946044d300c8825feaa3cb64fdc4ca Mon Sep 17 00:00:00 2001 From: Waiman Long Date: Sat, 31 Aug 2019 11:34:08 +0800 Subject: [PATCH] locking/qspinlock: Remove unnecessary BUG_ON() call mainline inclusion from mainline-5.1-rc1 commit 733000c7ffd9 category: bugfix bugzilla: 13227 CVE: NA ------------------------------------------------- With the > 4 nesting levels case handled by the commit: commit d682b596d993 ("locking/qspinlock: Handle > 4 slowpath nesting levels") the BUG_ON() call in encode_tail() will never actually be triggered. Remove it. Signed-off-by: Waiman Long Signed-off-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Cc: Andrew Morton Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/1551057253-3231-1-git-send-email-longman@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Hanjun Guo Signed-off-by: Wei Li Signed-off-by: Yang Yingliang --- kernel/locking/qspinlock.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/locking/qspinlock.c b/kernel/locking/qspinlock.c index c91a434fba4b..b186ef2dab25 100644 --- a/kernel/locking/qspinlock.c +++ b/kernel/locking/qspinlock.c @@ -124,9 +124,6 @@ static inline __pure u32 encode_tail(int cpu, int idx) { u32 tail; -#ifdef CONFIG_DEBUG_SPINLOCK - BUG_ON(idx > 3); -#endif tail = (cpu + 1) << _Q_TAIL_CPU_OFFSET; tail |= idx << _Q_TAIL_IDX_OFFSET; /* assume < 4 */ -- GitLab