summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilos Nikic <nikic.milos@gmail.com>2025-06-20 18:14:58 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-06-21 13:41:52 +0200
commit3c47e7bfc228e56fbc79e9b304a421fa3455ef85 (patch)
tree0eabf18c7f5f778373277db863417b962e4d84f2
parent8f9d61e8e9952dc0463cd24f6e4bbf9aea1e1d6f (diff)
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>
-rw-r--r--kern/lock_mon.c12
1 files 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 <ddb/db_sym.h>
#include <ddb/db_output.h>
-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)