@@ -82,7 +82,7 @@ static int __data_racy debug_objects_maxchain __read_mostly;
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,17 +103,16 @@ static DECLARE_DELAYED_WORK(debug_obj_work, free_obj_work);
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 ] = {
@@ -592,7 +591,7 @@ static struct debug_obj *lookup_object_or_alloc(void *addr, struct debug_bucket
592
591
}
593
592
594
593
/* Out of memory. Do the cleanup outside of the locked region */
595
- debug_objects_enabled = 0 ;
594
+ debug_objects_enabled = false ;
596
595
return NULL ;
597
596
}
598
597
@@ -1194,7 +1193,7 @@ check_results(void *addr, enum debug_obj_state state, int fixups, int warnings)
1194
1193
out :
1195
1194
raw_spin_unlock_irqrestore (& db -> lock , flags );
1196
1195
if (res )
1197
- debug_objects_enabled = 0 ;
1196
+ debug_objects_enabled = false ;
1198
1197
return res ;
1199
1198
}
1200
1199
@@ -1278,7 +1277,7 @@ static bool __init debug_objects_selftest(void)
1278
1277
descr_test = NULL ;
1279
1278
1280
1279
local_irq_restore (flags );
1281
- return !! debug_objects_enabled ;
1280
+ return debug_objects_enabled ;
1282
1281
}
1283
1282
#else
1284
1283
static inline bool debug_objects_selftest (void ) { return true; }
@@ -1372,7 +1371,7 @@ void __init debug_objects_mem_init(void)
1372
1371
SLAB_DEBUG_OBJECTS | SLAB_NOLEAKTRACE , NULL );
1373
1372
1374
1373
if (!cache || !debug_objects_replace_static_objects (cache )) {
1375
- debug_objects_enabled = 0 ;
1374
+ debug_objects_enabled = false ;
1376
1375
pr_warn ("Out of memory.\n" );
1377
1376
return ;
1378
1377
}
0 commit comments