From 3c47e7bfc228e56fbc79e9b304a421fa3455ef85 Mon Sep 17 00:00:00 2001 From: Milos Nikic Date: Fri, 20 Jun 2025 18:14:58 +0100 Subject: lock_mon: clean lip/lis functions The function lock_info_sort was defined as static and aliased via a macro to lis, requiring a forward declaration to be callable from lip(). This indirection served no functional purpose and made the code less readable and emitting a compiler (declared 'static' but never defined) warning. This change: - Removes the macro aliasing lock_info_sort to lis - Moves lock_info_sort before lip() to eliminate the need for a forward declaration - Updates the call in lip() to refer to lock_info_sort directly The result is a cleaner and more straightforward structure without changing behavior which also fixes a compiler warning. Message-ID: <20250620171458.8394-1-nikic.milos@gmail.com> --- kern/lock_mon.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/kern/lock_mon.c b/kern/lock_mon.c index 3ca4592c..edc8ae55 100644 --- a/kern/lock_mon.c +++ b/kern/lock_mon.c @@ -51,8 +51,6 @@ #include #include -static void lis(int arg, int abs, int count); - def_simple_lock_data(, kdb_lock) def_simple_lock_data(, printf_lock) @@ -169,12 +167,6 @@ decl_simple_lock_data(, *lock) } } -void lip(void) { - lis(4, 1, 0); -} - -#define lock_info_sort lis - static void lock_info_sort(int arg, int abs, int count) { struct lock_info *li, mean; @@ -251,6 +243,10 @@ static void lock_info_sort(int arg, int abs, int count) print_lock_info(&mean); } +void lip(void) { + lock_info_sort(4, 1, 0); +} + #define lock_info_clear lic void lock_info_clear(void) -- cgit v1.2.3