From: Olof Johansson <olof@lixom.net>
To: paulus@samba.org, gregkh@suse.de
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] [3/4] PMC-related cleanups
Date: Thu, 25 Jan 2007 02:20:02 -0600 [thread overview]
Message-ID: <20070125082002.GD10716@lixom.net> (raw)
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 *);
next reply other threads:[~2007-01-25 8:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-25 8:20 Olof Johansson [this message]
2007-01-26 22:32 ` [PATCH] [3/4] PMC-related cleanups Greg KH
2007-01-29 3:02 ` 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=20070125082002.GD10716@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.