Skip to contentSkip to conversation

kdb: Remove unused flags stack

PATCH In review [email protected] 2 participants 2 messages Jan 12, 2025 – Jan 13, 2025 KGDB / KDB /debug_core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kdb: Remove unused flags stack

From: "Dr. David Alan Gilbert" <[email protected]>

kdb_restore_flags() and kdb_save_flags() were added in 2010 by commit 5d5314d6795f ("kdb: core for kgdb back end (1 of 2)") but have remained unused.

Remove them, and their associated storage.

---
 include/linux/kdb.h            |  3 ---
 kernel/debug/kdb/kdb_support.c | 18 ------------------
 2 files changed, 21 deletions(-)
include/linux/kdb.h +0 -3
index f6c2ddb16b95..905a2e2f45f6 100644
@@ -140,9 +140,6 @@ extern const char *kdb_diemsg;
 
 extern unsigned int kdb_flags;	/* Global flags, see kdb_state for per cpu state */
 
-extern void kdb_save_flags(void);
-extern void kdb_restore_flags(void);
-
 #define KDB_FLAG(flag)		(kdb_flags & KDB_FLAG_##flag)
 #define KDB_FLAG_SET(flag)	((void)(kdb_flags |= KDB_FLAG_##flag))
 #define KDB_FLAG_CLEAR(flag)	((void)(kdb_flags &= ~KDB_FLAG_##flag))
kernel/debug/kdb/kdb_support.c +0 -18
index 0a39497140bf..4c545c658659 100644
@@ -536,21 +536,3 @@ bool kdb_task_state(const struct task_struct *p, const char *mask)
 
 	return strchr(mask, state);
 }
-
-/* Maintain a small stack of kdb_flags to allow recursion without disturbing
- * the global kdb state.
- */
-
-static int kdb_flags_stack[4], kdb_flags_index;
-
-void kdb_save_flags(void)
-{
-	BUG_ON(kdb_flags_index >= ARRAY_SIZE(kdb_flags_stack));
-	kdb_flags_stack[kdb_flags_index++] = kdb_flags;
-}
-
-void kdb_restore_flags(void)
-{
-	BUG_ON(kdb_flags_index <= 0);
-	kdb_flags = kdb_flags_stack[--kdb_flags_index];
-}
Signature · 1 line
2.47.1
reviewer Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 7 lines · On Sat, Jan 11, 2025 at 5:20 PM <[email protected]> wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

kdb_restore_flags() and kdb_save_flags() were added in 2010 by commit 5d5314d6795f ("kdb: core for kgdb back end (1 of 2)") but have remained unused.

Quoted 7 lines

Remove them, and their associated storage.

---
 include/linux/kdb.h            |  3 ---
 kernel/debug/kdb/kdb_support.c | 18 ------------------
 2 files changed, 21 deletions(-)