summaryrefslogtreecommitdiff
path: root/net/rds/ib_cm.c
diff options
context:
space:
mode:
authorZach Brown <zach.brown@oracle.com>2010-08-04 00:52:47 +0400
committerAndy Grover <andy.grover@oracle.com>2010-09-09 05:16:50 +0400
commit59f740a6aeb2cde2f79fe0df38262d4c1ef35cd8 (patch)
treee05c12cc5c8892bcca3928deb62121b1ee4cedd0 /net/rds/ib_cm.c
parent4518071ac1bcb76c64a55a3fddb39fb3d39add41 (diff)
downloadlinux-59f740a6aeb2cde2f79fe0df38262d4c1ef35cd8.tar.xz
RDS/IB: print string constants in more places
This prints the constant identifier for work completion status and rdma cm event types, like we already do for IB event types. A core string array helper is added that each string type uses. Signed-off-by: Zach Brown <zach.brown@oracle.com>
Diffstat (limited to 'net/rds/ib_cm.c')
-rw-r--r--net/rds/ib_cm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index 0e2fea893a76..bc3dbc1ba61f 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -39,7 +39,8 @@
#include "ib.h"
static char *rds_ib_event_type_strings[] = {
-#define RDS_IB_EVENT_STRING(foo) [IB_EVENT_##foo] = __stringify(foo)
+#define RDS_IB_EVENT_STRING(foo) \
+ [IB_EVENT_##foo] = __stringify(IB_EVENT_##foo)
RDS_IB_EVENT_STRING(CQ_ERR),
RDS_IB_EVENT_STRING(QP_FATAL),
RDS_IB_EVENT_STRING(QP_REQ_ERR),
@@ -63,11 +64,8 @@ static char *rds_ib_event_type_strings[] = {
static char *rds_ib_event_str(enum ib_event_type type)
{
- if (type < ARRAY_SIZE(rds_ib_event_type_strings) &&
- rds_ib_event_type_strings[type])
- return rds_ib_event_type_strings[type];
- else
- return "unknown";
+ return rds_str_array(rds_ib_event_type_strings,
+ ARRAY_SIZE(rds_ib_event_type_strings), type);
};
/*