LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* kobject.c changes in -mm
@ 2007-01-08 13:37 Christoph Hellwig
2007-01-08 19:09 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2007-01-08 13:37 UTC (permalink / raw)
To: akpm, gregkh; +Cc: linux-kernel
--- 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: kobject.c changes in -mm
2007-01-08 13:37 kobject.c changes in -mm Christoph Hellwig
@ 2007-01-08 19:09 ` Greg KH
2007-01-08 19:25 ` Frederik Deweerdt
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2007-01-08 19:09 UTC (permalink / raw)
To: Christoph Hellwig, akpm, linux-kernel; +Cc: haveblue
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: kobject.c changes in -mm
2007-01-08 19:09 ` Greg KH
@ 2007-01-08 19:25 ` Frederik Deweerdt
2007-01-08 20:31 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Frederik Deweerdt @ 2007-01-08 19:25 UTC (permalink / raw)
To: Greg KH; +Cc: Christoph Hellwig, akpm, linux-kernel, haveblue
On Mon, Jan 08, 2007 at 11:09:42AM -0800, Greg KH wrote:
> 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.
>
Could a CONFIG_{MM,HACK} option be added for this kind of hacks? It could
help clarify what the aim of the code is.
Regards,
Frederik
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: kobject.c changes in -mm
2007-01-08 19:25 ` Frederik Deweerdt
@ 2007-01-08 20:31 ` Greg KH
2007-01-08 21:56 ` Frederik Deweerdt
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2007-01-08 20:31 UTC (permalink / raw)
To: Frederik Deweerdt; +Cc: Christoph Hellwig, akpm, linux-kernel, haveblue
On Mon, Jan 08, 2007 at 07:25:07PM +0000, Frederik Deweerdt wrote:
> On Mon, Jan 08, 2007 at 11:09:42AM -0800, Greg KH wrote:
> > 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.
> >
> Could a CONFIG_{MM,HACK} option be added for this kind of hacks? It could
> help clarify what the aim of the code is.
How would that help here? I don't think we want to #ifdef all patches
in the -mm tree that are of this type, that would be a bit nasty.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: kobject.c changes in -mm
2007-01-08 20:31 ` Greg KH
@ 2007-01-08 21:56 ` Frederik Deweerdt
2007-01-08 22:17 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Frederik Deweerdt @ 2007-01-08 21:56 UTC (permalink / raw)
To: Greg KH; +Cc: Christoph Hellwig, akpm, linux-kernel, haveblue
On Mon, Jan 08, 2007 at 12:31:56PM -0800, Greg KH wrote:
> On Mon, Jan 08, 2007 at 07:25:07PM +0000, Frederik Deweerdt wrote:
> > On Mon, Jan 08, 2007 at 11:09:42AM -0800, Greg KH wrote:
> > > 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.
> > >
> > Could a CONFIG_{MM,HACK} option be added for this kind of hacks? It could
> > help clarify what the aim of the code is.
>
> How would that help here? I don't think we want to #ifdef all patches
> in the -mm tree that are of this type, that would be a bit nasty.
I see how this would be messy, but this could help advertising the fact
that the patch is not going to mainline, if only because mainline wouldn't
have that CONFIG_HACK thing.
Another alternative would a mm-only- prefix to the name of the patches,
a simple grep in broken-out would the be enough...
Regards,
Frederik
> thanks,
>
> greg k-h
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: kobject.c changes in -mm
2007-01-08 21:56 ` Frederik Deweerdt
@ 2007-01-08 22:17 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2007-01-08 22:17 UTC (permalink / raw)
To: Frederik Deweerdt; +Cc: Christoph Hellwig, akpm, linux-kernel, haveblue
On Mon, Jan 08, 2007 at 09:56:32PM +0000, Frederik Deweerdt wrote:
> On Mon, Jan 08, 2007 at 12:31:56PM -0800, Greg KH wrote:
> > On Mon, Jan 08, 2007 at 07:25:07PM +0000, Frederik Deweerdt wrote:
> > > On Mon, Jan 08, 2007 at 11:09:42AM -0800, Greg KH wrote:
> > > > 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.
> > > >
> > > Could a CONFIG_{MM,HACK} option be added for this kind of hacks? It could
> > > help clarify what the aim of the code is.
> >
> > How would that help here? I don't think we want to #ifdef all patches
> > in the -mm tree that are of this type, that would be a bit nasty.
> I see how this would be messy, but this could help advertising the fact
> that the patch is not going to mainline, if only because mainline wouldn't
> have that CONFIG_HACK thing.
> Another alternative would a mm-only- prefix to the name of the patches,
> a simple grep in broken-out would the be enough...
That's a good idea, I can rename some of these patches...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-01-08 22:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-08 13:37 kobject.c changes in -mm Christoph Hellwig
2007-01-08 19:09 ` Greg KH
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).