Skip to content

Commit e325246

Browse files
Du, Changbintorvalds
authored andcommitted
timer: update debugobjects fixup callbacks return type
Update the return type to use bool instead of int, corresponding to cheange (debugobjects: make fixup functions return bool instead of int). Signed-off-by: Du, Changbin <changbin.du@intel.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Josh Triplett <josh@kernel.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tejun Heo <tj@kernel.org> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 02a982a commit e325246

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

‎kernel/time/hrtimer.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -334,17 +334,17 @@ static void *hrtimer_debug_hint(void *addr)
334334
* fixup_init is called when:
335335
* - an active object is initialized
336336
*/
337-
static int hrtimer_fixup_init(void *addr, enum debug_obj_state state)
337+
static bool hrtimer_fixup_init(void *addr, enum debug_obj_state state)
338338
{
339339
struct hrtimer *timer = addr;
340340

341341
switch (state) {
342342
case ODEBUG_STATE_ACTIVE:
343343
hrtimer_cancel(timer);
344344
debug_object_init(timer, &hrtimer_debug_descr);
345-
return 1;
345+
return true;
346346
default:
347-
return 0;
347+
return false;
348348
}
349349
}
350350

@@ -353,37 +353,37 @@ static int hrtimer_fixup_init(void *addr, enum debug_obj_state state)
353353
* - an active object is activated
354354
* - an unknown object is activated (might be a statically initialized object)
355355
*/
356-
static int hrtimer_fixup_activate(void *addr, enum debug_obj_state state)
356+
static bool hrtimer_fixup_activate(void *addr, enum debug_obj_state state)
357357
{
358358
switch (state) {
359359

360360
case ODEBUG_STATE_NOTAVAILABLE:
361361
WARN_ON_ONCE(1);
362-
return 0;
362+
return false;
363363

364364
case ODEBUG_STATE_ACTIVE:
365365
WARN_ON(1);
366366

367367
default:
368-
return 0;
368+
return false;
369369
}
370370
}
371371

372372
/*
373373
* fixup_free is called when:
374374
* - an active object is freed
375375
*/
376-
static int hrtimer_fixup_free(void *addr, enum debug_obj_state state)
376+
static bool hrtimer_fixup_free(void *addr, enum debug_obj_state state)
377377
{
378378
struct hrtimer *timer = addr;
379379

380380
switch (state) {
381381
case ODEBUG_STATE_ACTIVE:
382382
hrtimer_cancel(timer);
383383
debug_object_free(timer, &hrtimer_debug_descr);
384-
return 1;
384+
return true;
385385
default:
386-
return 0;
386+
return false;
387387
}
388388
}
389389

‎kernel/time/timer.c‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -493,17 +493,17 @@ static void *timer_debug_hint(void *addr)
493493
* fixup_init is called when:
494494
* - an active object is initialized
495495
*/
496-
static int timer_fixup_init(void *addr, enum debug_obj_state state)
496+
static bool timer_fixup_init(void *addr, enum debug_obj_state state)
497497
{
498498
struct timer_list *timer = addr;
499499

500500
switch (state) {
501501
case ODEBUG_STATE_ACTIVE:
502502
del_timer_sync(timer);
503503
debug_object_init(timer, &timer_debug_descr);
504-
return 1;
504+
return true;
505505
default:
506-
return 0;
506+
return false;
507507
}
508508
}
509509

@@ -518,7 +518,7 @@ static void stub_timer(unsigned long data)
518518
* - an active object is activated
519519
* - an unknown object is activated (might be a statically initialized object)
520520
*/
521-
static int timer_fixup_activate(void *addr, enum debug_obj_state state)
521+
static bool timer_fixup_activate(void *addr, enum debug_obj_state state)
522522
{
523523
struct timer_list *timer = addr;
524524

@@ -534,44 +534,44 @@ static int timer_fixup_activate(void *addr, enum debug_obj_state state)
534534
timer->entry.next == TIMER_ENTRY_STATIC) {
535535
debug_object_init(timer, &timer_debug_descr);
536536
debug_object_activate(timer, &timer_debug_descr);
537-
return 0;
537+
return false;
538538
} else {
539539
setup_timer(timer, stub_timer, 0);
540-
return 1;
540+
return true;
541541
}
542-
return 0;
542+
return false;
543543

544544
case ODEBUG_STATE_ACTIVE:
545545
WARN_ON(1);
546546

547547
default:
548-
return 0;
548+
return false;
549549
}
550550
}
551551

552552
/*
553553
* fixup_free is called when:
554554
* - an active object is freed
555555
*/
556-
static int timer_fixup_free(void *addr, enum debug_obj_state state)
556+
static bool timer_fixup_free(void *addr, enum debug_obj_state state)
557557
{
558558
struct timer_list *timer = addr;
559559

560560
switch (state) {
561561
case ODEBUG_STATE_ACTIVE:
562562
del_timer_sync(timer);
563563
debug_object_free(timer, &timer_debug_descr);
564-
return 1;
564+
return true;
565565
default:
566-
return 0;
566+
return false;
567567
}
568568
}
569569

570570
/*
571571
* fixup_assert_init is called when:
572572
* - an untracked/uninit-ed object is found
573573
*/
574-
static int timer_fixup_assert_init(void *addr, enum debug_obj_state state)
574+
static bool timer_fixup_assert_init(void *addr, enum debug_obj_state state)
575575
{
576576
struct timer_list *timer = addr;
577577

@@ -584,13 +584,13 @@ static int timer_fixup_assert_init(void *addr, enum debug_obj_state state)
584584
* is tracked in the object tracker.
585585
*/
586586
debug_object_init(timer, &timer_debug_descr);
587-
return 0;
587+
return false;
588588
} else {
589589
setup_timer(timer, stub_timer, 0);
590-
return 1;
590+
return true;
591591
}
592592
default:
593-
return 0;
593+
return false;
594594
}
595595
}
596596

0 commit comments

Comments
 (0)