+#define UMAD_GENERIC_ATTRIBUTE_STR \
+ case UMAD_ATTR_CLASS_PORT_INFO: \
+ return Class Port Info; \
+ case UMAD_ATTR_NOTICE: \
+ return Notice; \
+ case UMAD_ATTR_INFORM_INFO: \
+ return Inform
On Thu, 21 Feb 2013 16:24:50 +
Hefty, Sean sean.he...@intel.com wrote:
+#define UMAD_GENERIC_ATTRIBUTE_STR \
+ case UMAD_ATTR_CLASS_PORT_INFO: \
+ return Class Port Info; \
+ case UMAD_ATTR_NOTICE: \
+ return Notice; \
+
This would definitely work but I was concerned that someone reading the header
file would confuse such a function with:
static inline char * umad_attribute_str(uint8_t mgmt_class, be16_t attr_id)
and not get proper decoding.
Anyway, that is what I was thinking. The macro is pretty
+#define UMAD_GENERIC_ATTRIBUTE_STR \
+ case UMAD_ATTR_CLASS_PORT_INFO: \
+ return Class Port Info; \
+ case UMAD_ATTR_NOTICE: \
+ return Notice; \
+ case UMAD_ATTR_INFORM_INFO: \
+ return Inform
On Tue, 19 Feb 2013 15:05:34 +
Hefty, Sean sean.he...@intel.com wrote:
+#define UMAD_GENERIC_ATTRIBUTE_STR \
+ case UMAD_ATTR_CLASS_PORT_INFO: \
+ return Class Port Info; \
+ case UMAD_ATTR_NOTICE: \
+ return Notice; \
+
This patch adds enum to string conversions of the enums in the headers
files submitted by Sean Hefty on 1/28/2013
Some of this code was originally proposed by Sean in 2010 as part of user space
madeye: http://www.mail-archive.com/linux-rdma@vger.kernel.org/msg06185.html
Signed-off-by: Ira Weiny