diff options
Diffstat (limited to 'net/rds/ib_cm.c')
-rw-r--r-- | net/rds/ib_cm.c | 10 |
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 @@ | |||
39 | #include "ib.h" | 39 | #include "ib.h" |
40 | 40 | ||
41 | static char *rds_ib_event_type_strings[] = { | 41 | static char *rds_ib_event_type_strings[] = { |
42 | #define RDS_IB_EVENT_STRING(foo) [IB_EVENT_##foo] = __stringify(foo) | 42 | #define RDS_IB_EVENT_STRING(foo) \ |
43 | [IB_EVENT_##foo] = __stringify(IB_EVENT_##foo) | ||
43 | RDS_IB_EVENT_STRING(CQ_ERR), | 44 | RDS_IB_EVENT_STRING(CQ_ERR), |
44 | RDS_IB_EVENT_STRING(QP_FATAL), | 45 | RDS_IB_EVENT_STRING(QP_FATAL), |
45 | RDS_IB_EVENT_STRING(QP_REQ_ERR), | 46 | RDS_IB_EVENT_STRING(QP_REQ_ERR), |
@@ -63,11 +64,8 @@ static char *rds_ib_event_type_strings[] = { | |||
63 | 64 | ||
64 | static char *rds_ib_event_str(enum ib_event_type type) | 65 | static char *rds_ib_event_str(enum ib_event_type type) |
65 | { | 66 | { |
66 | if (type < ARRAY_SIZE(rds_ib_event_type_strings) && | 67 | return rds_str_array(rds_ib_event_type_strings, |
67 | rds_ib_event_type_strings[type]) | 68 | ARRAY_SIZE(rds_ib_event_type_strings), type); |
68 | return rds_ib_event_type_strings[type]; | ||
69 | else | ||
70 | return "unknown"; | ||
71 | }; | 69 | }; |
72 | 70 | ||
73 | /* | 71 | /* |