public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: richard -rw- weinberger <richard.weinberger@gmail.com>,
	Witold Baryluk <baryluk@smp.if.uj.edu.pl>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Stanislaw Gruszka <sgruszka@redhat.com>,
	Marcin Slusarz <marcin.slusarz@gmail.com>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: ODEBUG: selftest warnings failed 4 != 5 (WARNING: at lib/debugobjects.c:908 check_results.constprop.9)
Date: Fri, 2 Mar 2012 13:23:32 -0800	[thread overview]
Message-ID: <20120302132332.f5d28264.akpm@linux-foundation.org> (raw)
In-Reply-To: <4F513995.6050509@codeaurora.org>

On Fri, 02 Mar 2012 13:20:21 -0800
Stephen Boyd <sboyd@codeaurora.org> wrote:

> > Dunno, sorry.  There are only two patches to bisect through - try
> > reverting b84d435cc228e ("debugobjects: Extend to assert that an object
> > is initialized") and then feac18dda25134 ("debugobjects: Be smarter
> > about static objects")?  
> 
> The fix is in -mm. Can we send the patch to Linus directly? Or perhaps
> go through Ingo since he sent the pull request in the first place?

Oh, OK, I had that queued for Thomas to mull over.  I'll send it in
for 3.3.


From: Stephen Boyd <sboyd@codeaurora.org>
Subject: 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:

[    0.000000] 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>
---

 lib/debugobjects.c |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff -puN lib/debugobjects.c~debugobjects-fix-selftest-for-static-warnings lib/debugobjects.c
--- a/lib/debugobjects.c~debugobjects-fix-selftest-for-static-warnings
+++ a/lib/debugobjects.c
@@ -818,17 +818,9 @@ static int __init fixup_activate(void *a
 		if (obj->static_init == 1) {
 			debug_object_init(obj, &descr_type_test);
 			debug_object_activate(obj, &descr_type_test);
-			/*
-			 * Real code should return 0 here ! This is
-			 * not a fixup of some bad behaviour. We
-			 * merily call the debug_init function to keep
-			 * track of the object.
-			 */
-			return 1;
-		} else {
-			/* Real code needs to emit a warning here */
+			return 0;
 		}
-		return 0;
+		return 1;
 
 	case ODEBUG_STATE_ACTIVE:
 		debug_object_deactivate(obj, &descr_type_test);
@@ -967,7 +959,7 @@ static void __init debug_objects_selftes
 
 	obj.static_init = 1;
 	debug_object_activate(&obj, &descr_type_test);
-	if (check_results(&obj, ODEBUG_STATE_ACTIVE, ++fixups, warnings))
+	if (check_results(&obj, ODEBUG_STATE_ACTIVE, fixups, warnings))
 		goto out;
 	debug_object_init(&obj, &descr_type_test);
 	if (check_results(&obj, ODEBUG_STATE_INIT, ++fixups, ++warnings))
_


      reply	other threads:[~2012-03-02 21:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-18  2:35 ODEBUG: selftest warnings failed 4 != 5 (WARNING: at lib/debugobjects.c:908 check_results.constprop.9) Witold Baryluk
2012-03-01 23:18 ` richard -rw- weinberger
2012-03-02 21:17   ` Andrew Morton
2012-03-02 21:20     ` Stephen Boyd
2012-03-02 21:23       ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120302132332.f5d28264.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=baryluk@smp.if.uj.edu.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.slusarz@gmail.com \
    --cc=mingo@elte.hu \
    --cc=richard.weinberger@gmail.com \
    --cc=sboyd@codeaurora.org \
    --cc=sgruszka@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox