Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

debugobjects: Make debug_objects_enabled bool

Make it what it is.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Zhen Lei <thunder.leizhen@huawei.com>
Link: https://lore.kernel.org/all/20241007164913.518175013@linutronix.de

+8 -9
+8 -9
lib/debugobjects.c
··· 82 82 static int __data_racy __maybe_unused debug_objects_maxchecked __read_mostly; 83 83 static int __data_racy debug_objects_fixups __read_mostly; 84 84 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 86 86 = CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT; 87 87 static int debug_objects_pool_size __ro_after_init 88 88 = ODEBUG_POOL_SIZE; ··· 103 103 104 104 static int __init enable_object_debug(char *str) 105 105 { 106 - debug_objects_enabled = 1; 106 + debug_objects_enabled = true; 107 107 return 0; 108 108 } 109 + early_param("debug_objects", enable_object_debug); 109 110 110 111 static int __init disable_object_debug(char *str) 111 112 { 112 - debug_objects_enabled = 0; 113 + debug_objects_enabled = false; 113 114 return 0; 114 115 } 115 - 116 - early_param("debug_objects", enable_object_debug); 117 116 early_param("no_debug_objects", disable_object_debug); 118 117 119 118 static const char *obj_states[ODEBUG_STATE_MAX] = { ··· 591 592 } 592 593 593 594 /* Out of memory. Do the cleanup outside of the locked region */ 594 - debug_objects_enabled = 0; 595 + debug_objects_enabled = false; 595 596 return NULL; 596 597 } 597 598 ··· 1193 1194 out: 1194 1195 raw_spin_unlock_irqrestore(&db->lock, flags); 1195 1196 if (res) 1196 - debug_objects_enabled = 0; 1197 + debug_objects_enabled = false; 1197 1198 return res; 1198 1199 } 1199 1200 ··· 1277 1278 descr_test = NULL; 1278 1279 1279 1280 local_irq_restore(flags); 1280 - return !!debug_objects_enabled; 1281 + return debug_objects_enabled; 1281 1282 } 1282 1283 #else 1283 1284 static inline bool debug_objects_selftest(void) { return true; } ··· 1371 1372 SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE, NULL); 1372 1373 1373 1374 if (!cache || !debug_objects_replace_static_objects(cache)) { 1374 - debug_objects_enabled = 0; 1375 + debug_objects_enabled = false; 1375 1376 pr_warn("Out of memory.\n"); 1376 1377 return; 1377 1378 }