Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306935
b: refs/heads/master
c: f522ae3
h: refs/heads/master
i:
  306933: ac50c1b
  306931: 1a9a02e
  306927: 4f92d5a
v: v3
  • Loading branch information
Gustavo Padovan authored and Gustavo Padovan committed May 16, 2012
1 parent 95352b6 commit 93229dc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 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: 2d0ed3d5879edae4bf1c98eb3163466c30d41789
refs/heads/master: f522ae363d5f20de172ea6f9973ba4cc44801f2b
33 changes: 18 additions & 15 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,16 @@ static inline u16 l2cap_seq_list_pop(struct l2cap_seq_list *seq_list)

static void l2cap_seq_list_clear(struct l2cap_seq_list *seq_list)
{
if (seq_list->head != L2CAP_SEQ_LIST_CLEAR) {
u16 i;
for (i = 0; i <= seq_list->mask; i++)
seq_list->list[i] = L2CAP_SEQ_LIST_CLEAR;
u16 i;

seq_list->head = L2CAP_SEQ_LIST_CLEAR;
seq_list->tail = L2CAP_SEQ_LIST_CLEAR;
}
if (seq_list->head == L2CAP_SEQ_LIST_CLEAR)
return;

for (i = 0; i <= seq_list->mask; i++)
seq_list->list[i] = L2CAP_SEQ_LIST_CLEAR;

seq_list->head = L2CAP_SEQ_LIST_CLEAR;
seq_list->tail = L2CAP_SEQ_LIST_CLEAR;
}

static void l2cap_seq_list_append(struct l2cap_seq_list *seq_list, u16 seq)
Expand All @@ -326,15 +328,16 @@ static void l2cap_seq_list_append(struct l2cap_seq_list *seq_list, u16 seq)

/* All appends happen in constant time */

if (seq_list->list[seq & mask] == L2CAP_SEQ_LIST_CLEAR) {
if (seq_list->tail == L2CAP_SEQ_LIST_CLEAR)
seq_list->head = seq;
else
seq_list->list[seq_list->tail & mask] = seq;
if (seq_list->list[seq & mask] != L2CAP_SEQ_LIST_CLEAR)
return;

seq_list->tail = seq;
seq_list->list[seq & mask] = L2CAP_SEQ_LIST_TAIL;
}
if (seq_list->tail == L2CAP_SEQ_LIST_CLEAR)
seq_list->head = seq;
else
seq_list->list[seq_list->tail & mask] = seq;

seq_list->tail = seq;
seq_list->list[seq & mask] = L2CAP_SEQ_LIST_TAIL;
}

static void l2cap_chan_timeout(struct work_struct *work)
Expand Down

0 comments on commit 93229dc

Please sign in to comment.