All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Christoph Hellwig <hch@infradead.org>,
	akpm@osdl.org, linux-kernel@vger.kernel.org
Cc: haveblue@us.ibm.com
Subject: Re: kobject.c changes in -mm
Date: Mon, 8 Jan 2007 11:09:42 -0800	[thread overview]
Message-ID: <20070108190942.GA23629@suse.de> (raw)
In-Reply-To: <20070108133747.GA19692@infradead.org>

On Mon, Jan 08, 2007 at 01:37:47PM +0000, Christoph Hellwig wrote:
> --- linux-2.6.20-rc3/lib/kobject.c      2007-01-01 23:04:49.000000000 -0800
> +++ devel/lib/kobject.c 2007-01-04 21:13:21.000000000 -0800
> @@ -15,6 +15,8 @@
>  #include <linux/module.h>
>  #include <linux/stat.h>
>  #include <linux/slab.h>
> +#include <linux/kallsyms.h>
> +#include <asm-generic/sections.h>
> 
> +#ifdef CONFIG_X86_32
> +static int ptr_in_range(void *ptr, void *start, void *end)
> +{
> +       /*
> +        * This should hopefully get rid of causing warnings
> +        * if the architecture did not set one of the section
> +        * variables up.
> +        */ 
> +       if (start >= end)
> +               return 0;
> +
> +       if ((ptr >= start) && (ptr < end))
> +               return 1;
> +       return 0;
> +}      
> 
> 
> Can anyone explain WTF is going on here?  Including asm-generic headers
> in core code definitly is not okay.  As are random CONFIG_X86_32 ifdefs
> in said code.

It's a hack for debugging.  See the full patch at:
	http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/driver/warn-when-statically-allocated-kobjects-are-used.patch

It is never going to go to mainline, due to the arch-specific hacks as
you have noted.  But is good to have for debugging and getting error
reports from users of -mm.

thanks,

greg k-h

  reply	other threads:[~2007-01-08 19:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-08 13:37 kobject.c changes in -mm Christoph Hellwig
2007-01-08 19:09 ` Greg KH [this message]
2007-01-08 19:25   ` Frederik Deweerdt
2007-01-08 20:31     ` Greg KH
2007-01-08 21:56       ` Frederik Deweerdt
2007-01-08 22:17         ` Greg KH

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=20070108190942.GA23629@suse.de \
    --to=gregkh@suse.de \
    --cc=akpm@osdl.org \
    --cc=haveblue@us.ibm.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.