[PATCH] [3/4] PMC-related cleanups

STALE7126d

3 messages, 2 authors, 2007-01-29 · open the first message on its own page

[PATCH] [3/4] PMC-related cleanups

From: Olof Johansson <hidden>
Date: 2007-01-25 08:14:13

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 <redacted>


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 *);

Re: [PATCH] [3/4] PMC-related cleanups

From: Greg KH <gregkh@suse.de>
Date: 2007-01-26 22:33:09

On Thu, Jan 25, 2007 at 02:20:02AM -0600, Olof Johansson wrote:
quoted hunk
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 <redacted>


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 [off-list ref]

to the patch and send it through Paul.

thanks,

greg k-h

Re: [PATCH] [3/4] PMC-related cleanups

From: Olof Johansson <hidden>
Date: 2007-01-29 02:56:29

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:
quoted
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 <redacted>


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 [off-list ref]

to the patch and send it through Paul.
Thanks!


-Olof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help