Prev: (none)
Next: Where is proc_misc.c?
From: Greg KH on 21 Jan 2010 18:20 On Wed, Jan 20, 2010 at 05:44:41PM +1100, Stephen Rothwell wrote: > Hi Greg, > > On Wed, 20 Jan 2010 17:25:43 +1100 Stephen Rothwell <sfr(a)canb.auug.org.au> wrote: > > > > (lines 262-266) > > static struct sysdev_class_attribute *cpu_sysdev_class_attrs[] = { > > #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE > > &class_attr_probe.attr, > > &class_attr_release.attr, > > #endif > > The reason you may not see this is because CONFIG_ARCH_CPU_PROBE_RELEASE > is not set for x86_64 allmodconfig builds (and probably many others). Ah, you are right, I was focusing on the lines after this. Here's a patch that I just applied to my tree to hopefully resolve this issue. thanks, greg k-h ---------- From: Greg Kroah-Hartman <gregkh(a)suse.de> Subject: sysdev: fix up the probe/release attributes These should be sysdev attributes, not class attributes. This patch should resolve the problem. Thanks to Stephen Rothwell for pointing out the problem. Reported-by: Stephen Rothwell <sfr(a)canb.auug.org.au> Cc: Andi Kleen <andi(a)firstfloor.org> Signed-off-by: Greg Kroah-Hartman <gregkh(a)suse.de> --- drivers/base/cpu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -79,24 +79,24 @@ void unregister_cpu(struct cpu *cpu) } #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE -static ssize_t cpu_probe_store(struct class *class, - struct class_attribute *attr, +static ssize_t cpu_probe_store(struct sys_device *dev, + struct sysdev_attribute *attr, const char *buf, size_t count) { return arch_cpu_probe(buf, count); } -static ssize_t cpu_release_store(struct class *class, - struct class_attribute *attr, +static ssize_t cpu_release_store(struct sys_device *dev, + struct sysdev_attribute *attr, const char *buf, size_t count) { return arch_cpu_release(buf, count); } -static CLASS_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); -static CLASS_ATTR(release, S_IWUSR, NULL, cpu_release_store); +static SYSDEV_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); +static SYSDEV_ATTR(release, S_IWUSR, NULL, cpu_release_store); #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ #else /* ... !CONFIG_HOTPLUG_CPU */ @@ -261,8 +261,8 @@ int __init cpu_dev_init(void) static struct sysdev_class_attribute *cpu_sysdev_class_attrs[] = { #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE - &class_attr_probe.attr, - &class_attr_release.attr, + &attr_probe.attr, + &attr_release.attr, #endif &cpu_attrs[0].attr, &cpu_attrs[1].attr, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Stephen Rothwell on 21 Jan 2010 18:30 Hi Greg, On Thu, 21 Jan 2010 15:10:10 -0800 Greg KH <greg(a)kroah.com> wrote: > > Ah, you are right, I was focusing on the lines after this. > > Here's a patch that I just applied to my tree to hopefully resolve this > issue. Thanks. -- Cheers, Stephen Rothwell sfr(a)canb.auug.org.au http://www.canb.auug.org.au/~sfr/
From: Stephen Rothwell on 29 Jan 2010 02:30 Hi Greg, On Thu, 21 Jan 2010 15:10:10 -0800 Greg KH <greg(a)kroah.com> wrote: > > Here's a patch that I just applied to my tree to hopefully resolve this > issue. I still get the warnings. > -static CLASS_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); > -static CLASS_ATTR(release, S_IWUSR, NULL, cpu_release_store); > +static SYSDEV_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); This defines attr_probe as a "struct sysdev_attribute" whose attr element is a "struct attribute". > +static SYSDEV_ATTR(release, S_IWUSR, NULL, cpu_release_store); > #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ > > #else /* ... !CONFIG_HOTPLUG_CPU */ > @@ -261,8 +261,8 @@ int __init cpu_dev_init(void) > > static struct sysdev_class_attribute *cpu_sysdev_class_attrs[] = { > #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE > - &class_attr_probe.attr, > - &class_attr_release.attr, > + &attr_probe.attr, so here we are initialising a "struct sysdev_class_attribute *" with a "struct attribute *". Thus the warning. > + &attr_release.attr, -- Cheers, Stephen Rothwell sfr(a)canb.auug.org.au http://www.canb.auug.org.au/~sfr/
From: Greg KH on 2 Feb 2010 22:20 On Fri, Jan 29, 2010 at 06:21:15PM +1100, Stephen Rothwell wrote: > Hi Greg, > > On Thu, 21 Jan 2010 15:10:10 -0800 Greg KH <greg(a)kroah.com> wrote: > > > > Here's a patch that I just applied to my tree to hopefully resolve this > > issue. > > I still get the warnings. > > > -static CLASS_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); > > -static CLASS_ATTR(release, S_IWUSR, NULL, cpu_release_store); > > +static SYSDEV_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); > > This defines attr_probe as a "struct sysdev_attribute" whose attr element > is a "struct attribute". > > > +static SYSDEV_ATTR(release, S_IWUSR, NULL, cpu_release_store); > > #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ > > > > #else /* ... !CONFIG_HOTPLUG_CPU */ > > @@ -261,8 +261,8 @@ int __init cpu_dev_init(void) > > > > static struct sysdev_class_attribute *cpu_sysdev_class_attrs[] = { > > #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE > > - &class_attr_probe.attr, > > - &class_attr_release.attr, > > + &attr_probe.attr, > > so here we are initialising a "struct sysdev_class_attribute *" with a > "struct attribute *". Thus the warning. Doh, sorry about that. I've fixed it up now and pushed it out. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Stephen Rothwell on 2 Feb 2010 22:30
Hi Greg, On Tue, 2 Feb 2010 18:22:47 -0800 Greg KH <greg(a)kroah.com> wrote: > > Doh, sorry about that. I've fixed it up now and pushed it out. Great, thanks. -- Cheers, Stephen Rothwell sfr(a)canb.auug.org.au http://www.canb.auug.org.au/~sfr/ |