All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom.net>
To: paulus@samba.org
Cc: linuxppc-dev@ozlabs.org, gregkh@suse.de
Subject: [PATCH] [3/4] Introduce _SYSDEV_ATTR
Date: Sun, 28 Jan 2007 21:24:57 -0600	[thread overview]
Message-ID: <20070129032457.GF6412@lixom.net> (raw)
In-Reply-To: <20070129032143.GC6412@lixom.net>

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>                                              


Index: merge/include/linux/sysdev.h
===================================================================
--- merge.orig/include/linux/sysdev.h
+++ merge/include/linux/sysdev.h
@@ -98,12 +98,16 @@ struct sysdev_attribute { 
 };
 
 
-#define SYSDEV_ATTR(_name,_mode,_show,_store) 		\
-struct sysdev_attribute attr_##_name = { 			\
-	.attr = {.name = __stringify(_name), .mode = _mode },	\
+#define _SYSDEV_ATTR(_name,_mode,_show,_store)			\
+{								\
+	.attr = { .name = __stringify(_name), .mode = _mode,	\
+		 .owner = THIS_MODULE },			\
 	.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 *);

  parent reply	other threads:[~2007-01-29  3:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-29  3:21 [PATCH] [0/4] PMC-related cleanups [v2] Olof Johansson
2007-01-29  3:23 ` [PATCH] [1/4] powerpc: Oprofile cleanup [v2] Olof Johansson
2007-01-29  3:23 ` [PATCH] [2/4] powerpc: Add PMC type to cputable [v2] Olof Johansson
2007-01-29  3:24 ` Olof Johansson [this message]
2007-01-29  3:25 ` [PATCH] [4/4] powerpc: PA6T PMC support [v2] Olof Johansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070129032457.GF6412@lixom.net \
    --to=olof@lixom.net \
    --cc=gregkh@suse.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.