linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [3/4] PMC-related cleanups
@ 2007-01-25  8:20 Olof Johansson
  2007-01-26 22:32 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Olof Johansson @ 2007-01-25  8:20 UTC (permalink / raw)
  To: paulus, gregkh; +Cc: linuxppc-dev

Introduce _SYSDEV_ATTR(), to be used to just define the struct, and not a
named variable with the attribute. Useful for arrays of sysdev_attributes.

Signed-off-by: Olof Johansson <olof@lixom.net>


Index: powerpc/include/linux/sysdev.h
===================================================================
--- powerpc.orig/include/linux/sysdev.h
+++ powerpc/include/linux/sysdev.h
@@ -98,12 +98,15 @@ struct sysdev_attribute { 
 };
 
 
-#define SYSDEV_ATTR(_name,_mode,_show,_store) 		\
-struct sysdev_attribute attr_##_name = { 			\
+#define _SYSDEV_ATTR(_name,_mode,_show,_store)			\
+{								\
 	.attr = {.name = __stringify(_name), .mode = _mode },	\
 	.show	= _show,					\
 	.store	= _store,					\
-};
+}
+
+#define SYSDEV_ATTR(_name,_mode,_show,_store)		\
+struct sysdev_attribute attr_##_name = _SYSDEV_ATTR(_name,_mode,_show,_store);
 
 extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
 extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [3/4] PMC-related cleanups
  2007-01-25  8:20 [PATCH] [3/4] PMC-related cleanups Olof Johansson
@ 2007-01-26 22:32 ` Greg KH
  2007-01-29  3:02   ` Olof Johansson
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2007-01-26 22:32 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, paulus

On Thu, Jan 25, 2007 at 02:20:02AM -0600, Olof Johansson wrote:
> Introduce _SYSDEV_ATTR(), to be used to just define the struct, and not a
> named variable with the attribute. Useful for arrays of sysdev_attributes.
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>
> 
> 
> Index: powerpc/include/linux/sysdev.h
> ===================================================================
> --- powerpc.orig/include/linux/sysdev.h
> +++ powerpc/include/linux/sysdev.h
> @@ -98,12 +98,15 @@ struct sysdev_attribute { 
>  };
>  
>  
> -#define SYSDEV_ATTR(_name,_mode,_show,_store) 		\
> -struct sysdev_attribute attr_##_name = { 			\
> +#define _SYSDEV_ATTR(_name,_mode,_show,_store)			\
> +{								\
>  	.attr = {.name = __stringify(_name), .mode = _mode },	\
>  	.show	= _show,					\
>  	.store	= _store,					\
> -};
> +}

Oops, you need to add '.owner' to that attribute structure.  In all
fairness, it's a bug, not caused by anything that you did.

If you add that, feel free to add my:
	Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

to the patch and send it through Paul.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [3/4] PMC-related cleanups
  2007-01-26 22:32 ` Greg KH
@ 2007-01-29  3:02   ` Olof Johansson
  0 siblings, 0 replies; 3+ messages in thread
From: Olof Johansson @ 2007-01-29  3:02 UTC (permalink / raw)
  To: Greg KH; +Cc: linuxppc-dev, paulus

On Fri, Jan 26, 2007 at 02:32:04PM -0800, Greg KH wrote:
> On Thu, Jan 25, 2007 at 02:20:02AM -0600, Olof Johansson wrote:
> > Introduce _SYSDEV_ATTR(), to be used to just define the struct, and not a
> > named variable with the attribute. Useful for arrays of sysdev_attributes.
> > 
> > Signed-off-by: Olof Johansson <olof@lixom.net>
> > 
> > 
> > Index: powerpc/include/linux/sysdev.h
> > ===================================================================
> > --- powerpc.orig/include/linux/sysdev.h
> > +++ powerpc/include/linux/sysdev.h
> > @@ -98,12 +98,15 @@ struct sysdev_attribute { 
> >  };
> >  
> >  
> > -#define SYSDEV_ATTR(_name,_mode,_show,_store) 		\
> > -struct sysdev_attribute attr_##_name = { 			\
> > +#define _SYSDEV_ATTR(_name,_mode,_show,_store)			\
> > +{								\
> >  	.attr = {.name = __stringify(_name), .mode = _mode },	\
> >  	.show	= _show,					\
> >  	.store	= _store,					\
> > -};
> > +}
> 
> Oops, you need to add '.owner' to that attribute structure.  In all
> fairness, it's a bug, not caused by anything that you did.

Got it, see repost.

> If you add that, feel free to add my:
> 	Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> 
> to the patch and send it through Paul.

Thanks!


-Olof

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-29  2:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25  8:20 [PATCH] [3/4] PMC-related cleanups Olof Johansson
2007-01-26 22:32 ` Greg KH
2007-01-29  3:02   ` Olof Johansson

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).