aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2012-03-05 17:59:17 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-05 18:49:43 -0500
commit9f78ff005a6b6313728247113948450b2adddde8 (patch)
tree91bf021b9d2d1a09ae74a39c11275aacaf6082f1 /lib
parent9354f1b8e6c55c335d1c4fb10d0ae7a041935240 (diff)
debugobjects: Fix selftest for static warnings
debugobjects is now printing a warning when a fixup for a NOTAVAILABLE object is run. This causes the selftest to fail like: ODEBUG: selftest warnings failed 4 != 5 We could just increase the number of warnings that the selftest is expecting to see because that is actually what has changed. But, it turns out that fixup_activate() was written with inverted logic and thus a fixup for a static object returned 1 indicating the object had been fixed, and 0 otherwise. Fix the logic to be correct and update the counts to reflect that nothing needed fixing for a static object. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Reported-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/debugobjects.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 77cb245f8e7b..0ab9ae8057f0 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -818,17 +818,9 @@ static int __init fixup_activate(void *addr, enum debug_obj_state state)
818 if (obj->static_init == 1) { 818 if (obj->static_init == 1) {
819 debug_object_init(obj, &descr_type_test); 819 debug_object_init(obj, &descr_type_test);
820 debug_object_activate(obj, &descr_type_test); 820 debug_object_activate(obj, &descr_type_test);
821 /* 821 return 0;
822 * Real code should return 0 here ! This is
823 * not a fixup of some bad behaviour. We
824 * merily call the debug_init function to keep
825 * track of the object.
826 */
827 return 1;
828 } else {
829 /* Real code needs to emit a warning here */
830 } 822 }
831 return 0; 823 return 1;
832 824
833 case ODEBUG_STATE_ACTIVE: 825 case ODEBUG_STATE_ACTIVE:
834 debug_object_deactivate(obj, &descr_type_test); 826 debug_object_deactivate(obj, &descr_type_test);
@@ -967,7 +959,7 @@ static void __init debug_objects_selftest(void)
967 959
968 obj.static_init = 1; 960 obj.static_init = 1;
969 debug_object_activate(&obj, &descr_type_test); 961 debug_object_activate(&obj, &descr_type_test);
970 if (check_results(&obj, ODEBUG_STATE_ACTIVE, ++fixups, warnings)) 962 if (check_results(&obj, ODEBUG_STATE_ACTIVE, fixups, warnings))
971 goto out; 963 goto out;
972 debug_object_init(&obj, &descr_type_test); 964 debug_object_init(&obj, &descr_type_test);
973 if (check_results(&obj, ODEBUG_STATE_INIT, ++fixups, ++warnings)) 965 if (check_results(&obj, ODEBUG_STATE_INIT, ++fixups, ++warnings))