Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362650
b: refs/heads/master
c: e15465e
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Apr 19, 2013
1 parent d777353 commit 4df991a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd7fc253289c419615c1c8bbe418598019567392
refs/heads/master: e15465e1808542743627f13d1c0cbb7eacc82b83
3 changes: 2 additions & 1 deletion trunk/include/net/irda/irlmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ static inline __u32 irlmp_get_daddr(const struct lsap_cb *self)
return (self && self->lap) ? self->lap->daddr : 0;
}

extern const char *irlmp_reasons[];
const char *irlmp_reason_str(LM_REASON reason);

extern int sysctl_discovery_timeout;
extern int sysctl_discovery_slots;
extern int sysctl_discovery;
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/irda/iriap.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ static void iriap_disconnect_indication(void *instance, void *sap,
{
struct iriap_cb *self;

IRDA_DEBUG(4, "%s(), reason=%s\n", __func__, irlmp_reasons[reason]);
IRDA_DEBUG(4, "%s(), reason=%s [%d]\n", __func__,
irlmp_reason_str(reason), reason);

self = instance;

Expand Down
10 changes: 9 additions & 1 deletion trunk/net/irda/irlmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,15 @@ const char *irlmp_reasons[] = {
"LM_LAP_RESET",
"LM_INIT_DISCONNECT",
"ERROR, NOT USED",
"UNKNOWN",
};

const char *irlmp_reason_str(LM_REASON reason)
{
reason = min_t(size_t, reason, ARRAY_SIZE(irlmp_reasons) - 1);
return irlmp_reasons[reason];
}

/*
* Function irlmp_init (void)
*
Expand Down Expand Up @@ -747,7 +754,8 @@ void irlmp_disconnect_indication(struct lsap_cb *self, LM_REASON reason,
{
struct lsap_cb *lsap;

IRDA_DEBUG(1, "%s(), reason=%s\n", __func__, irlmp_reasons[reason]);
IRDA_DEBUG(1, "%s(), reason=%s [%d]\n", __func__,
irlmp_reason_str(reason), reason);
IRDA_ASSERT(self != NULL, return;);
IRDA_ASSERT(self->magic == LMP_LSAP_MAGIC, return;);

Expand Down

0 comments on commit 4df991a

Please sign in to comment.