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

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