mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] [2/3] sysfs: Add utility macros for declaring generic extended sysdev attributes
Date: Tue,  2 Sep 2008 13:26:35 +0200 (CEST)	[thread overview]
Message-ID: <20080902112635.3F0ED3E6A00@basil.firstfloor.org> (raw)
In-Reply-To: <20080902126.215915333@firstfloor.org>


This is similar to _SYSDEV_ULONG_ATTR, but allows to use 

Needed for followup patch.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

---
 include/linux/sysdev.h |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: linux/include/linux/sysdev.h
===================================================================
--- linux.orig/include/linux/sysdev.h
+++ linux/include/linux/sysdev.h
@@ -139,7 +139,12 @@ extern ssize_t sysdev_show_int(struct sy
 				char *);
 extern ssize_t sysdev_store_int(struct sys_device *,
 			struct sysdev_attribute *, const char *, size_t);
-
+#define _SYSDEV_EXT_ATTR(_name, _mode, _var, _show, _store)	\
+	{ _SYSDEV_ATTR(_name, _mode, _show, _store),		\
+	  &(_var) }
+#define SYSDEV_EXT_ATTR(_name, _mode, _var, _show, _store)	\
+	struct sysdev_ext_attribute attr_##_name =		\
+		_SYSDEV_EXT_ATTR(_name, _mode, _var, _show, _store);
 #define _SYSDEV_ULONG_ATTR(_name, _mode, _var)				\
 	{ _SYSDEV_ATTR(_name, _mode, sysdev_show_ulong, sysdev_store_ulong), \
 	  &(_var) }

  reply	other threads:[~2008-09-02 11:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-02 11:26 [PATCH] [1/3] MCE: Implement dynamic machine check banks support Andi Kleen
2008-09-02 11:26 ` Andi Kleen [this message]
2008-09-02 11:26 ` [PATCH] [3/3] MCE: Convert the mce code to use generic sysdev attributes Andi Kleen

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=20080902112635.3F0ED3E6A00@basil.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®