RE: [PATCH] libibumad: add string functions for various defines

2013-02-21 Thread Hefty, Sean
+#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

Re: [PATCH] libibumad: add string functions for various defines

2013-02-21 Thread Ira Weiny
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; \ +

RE: [PATCH] libibumad: add string functions for various defines

2013-02-21 Thread Hefty, Sean
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

RE: [PATCH] libibumad: add string functions for various defines

2013-02-19 Thread Hefty, Sean
+#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

Re: [PATCH] libibumad: add string functions for various defines

2013-02-19 Thread Ira Weiny
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; \ +

[PATCH] libibumad: add string functions for various defines

2013-02-18 Thread Ira Weiny
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