diff options
Diffstat (limited to 'net/irda/irlmp.c')
-rw-r--r-- | net/irda/irlmp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index 6115a44c0a24..1064621da6f6 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c | |||
@@ -66,8 +66,15 @@ const char *irlmp_reasons[] = { | |||
66 | "LM_LAP_RESET", | 66 | "LM_LAP_RESET", |
67 | "LM_INIT_DISCONNECT", | 67 | "LM_INIT_DISCONNECT", |
68 | "ERROR, NOT USED", | 68 | "ERROR, NOT USED", |
69 | "UNKNOWN", | ||
69 | }; | 70 | }; |
70 | 71 | ||
72 | const char *irlmp_reason_str(LM_REASON reason) | ||
73 | { | ||
74 | reason = min_t(size_t, reason, ARRAY_SIZE(irlmp_reasons) - 1); | ||
75 | return irlmp_reasons[reason]; | ||
76 | } | ||
77 | |||
71 | /* | 78 | /* |
72 | * Function irlmp_init (void) | 79 | * Function irlmp_init (void) |
73 | * | 80 | * |
@@ -747,7 +754,8 @@ void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason, | |||
747 | { | 754 | { |
748 | struct lsap_cb *lsap; | 755 | struct lsap_cb *lsap; |
749 | 756 | ||
750 | IRDA_DEBUG(1, "%s(), reason=%s\n", __func__, irlmp_reasons[reason]); | 757 | IRDA_DEBUG(1, "%s(), reason=%s [%d]\n", __func__, |
758 | irlmp_reason_str(reason), reason); | ||
751 | IRDA_ASSERT(self != NULL, return;); | 759 | IRDA_ASSERT(self != NULL, return;); |
752 | IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;); | 760 | IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;); |
753 | 761 | ||