Commit f522ae36 authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Gustavo Padovan

Bluetooth: improve readability of l2cap_seq_list code

Removes one indentation level.
Signed-off-by: default avatarGustavo Padovan <gustavo@padovan.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 2d0ed3d5
...@@ -310,14 +310,16 @@ static inline u16 l2cap_seq_list_pop(struct l2cap_seq_list *seq_list) ...@@ -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) static void l2cap_seq_list_clear(struct l2cap_seq_list *seq_list)
{ {
if (seq_list->head != L2CAP_SEQ_LIST_CLEAR) { u16 i;
u16 i;
for (i = 0; i <= seq_list->mask; i++)
seq_list->list[i] = L2CAP_SEQ_LIST_CLEAR;
seq_list->head = L2CAP_SEQ_LIST_CLEAR; if (seq_list->head == L2CAP_SEQ_LIST_CLEAR)
seq_list->tail = 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) static void l2cap_seq_list_append(struct l2cap_seq_list *seq_list, u16 seq)
...@@ -326,15 +328,16 @@ static void l2cap_seq_list_append(struct l2cap_seq_list *seq_list, u16 seq) ...@@ -326,15 +328,16 @@ static void l2cap_seq_list_append(struct l2cap_seq_list *seq_list, u16 seq)
/* All appends happen in constant time */ /* All appends happen in constant time */
if (seq_list->list[seq & mask] == L2CAP_SEQ_LIST_CLEAR) { if (seq_list->list[seq & mask] != L2CAP_SEQ_LIST_CLEAR)
if (seq_list->tail == L2CAP_SEQ_LIST_CLEAR) return;
seq_list->head = seq;
else
seq_list->list[seq_list->tail & mask] = seq;
seq_list->tail = seq; if (seq_list->tail == L2CAP_SEQ_LIST_CLEAR)
seq_list->list[seq & mask] = L2CAP_SEQ_LIST_TAIL; 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) static void l2cap_chan_timeout(struct work_struct *work)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment