Skip to content

Commit 661cc28

Browse files
committed
debugobjects: Make debug_objects_enabled bool
Make it what it is. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Zhen Lei <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 49a5cb8 commit 661cc28

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/debugobjects.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static int __data_racy debug_objects_maxchain __read_mostly;
8282
static int __data_racy __maybe_unused debug_objects_maxchecked __read_mostly;
8383
static int __data_racy debug_objects_fixups __read_mostly;
8484
static int __data_racy debug_objects_warnings __read_mostly;
85-
static int __data_racy debug_objects_enabled __read_mostly
85+
static bool __data_racy debug_objects_enabled __read_mostly
8686
= CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT;
8787
static int debug_objects_pool_size __ro_after_init
8888
= ODEBUG_POOL_SIZE;
@@ -103,17 +103,16 @@ static DECLARE_DELAYED_WORK(debug_obj_work, free_obj_work);
103103

104104
static int __init enable_object_debug(char *str)
105105
{
106-
debug_objects_enabled = 1;
106+
debug_objects_enabled = true;
107107
return 0;
108108
}
109+
early_param("debug_objects", enable_object_debug);
109110

110111
static int __init disable_object_debug(char *str)
111112
{
112-
debug_objects_enabled = 0;
113+
debug_objects_enabled = false;
113114
return 0;
114115
}
115-
116-
early_param("debug_objects", enable_object_debug);
117116
early_param("no_debug_objects", disable_object_debug);
118117

119118
static const char *obj_states[ODEBUG_STATE_MAX] = {
@@ -592,7 +591,7 @@ static struct debug_obj *lookup_object_or_alloc(void *addr, struct debug_bucket
592591
}
593592

594593
/* Out of memory. Do the cleanup outside of the locked region */
595-
debug_objects_enabled = 0;
594+
debug_objects_enabled = false;
596595
return NULL;
597596
}
598597

@@ -1194,7 +1193,7 @@ check_results(void *addr, enum debug_obj_state state, int fixups, int warnings)
11941193
out:
11951194
raw_spin_unlock_irqrestore(&db->lock, flags);
11961195
if (res)
1197-
debug_objects_enabled = 0;
1196+
debug_objects_enabled = false;
11981197
return res;
11991198
}
12001199

@@ -1278,7 +1277,7 @@ static bool __init debug_objects_selftest(void)
12781277
descr_test = NULL;
12791278

12801279
local_irq_restore(flags);
1281-
return !!debug_objects_enabled;
1280+
return debug_objects_enabled;
12821281
}
12831282
#else
12841283
static inline bool debug_objects_selftest(void) { return true; }
@@ -1372,7 +1371,7 @@ void __init debug_objects_mem_init(void)
13721371
SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE, NULL);
13731372

13741373
if (!cache || !debug_objects_replace_static_objects(cache)) {
1375-
debug_objects_enabled = 0;
1374+
debug_objects_enabled = false;
13761375
pr_warn("Out of memory.\n");
13771376
return;
13781377
}

0 commit comments

Comments
 (0)