Skip to content

Commit

Permalink
Bluetooth: debug: Correct types specifiers for L2CAP
Browse files Browse the repository at this point in the history
Avoid unneeded type conversion by correcting type specifiers in debug
statements for L2CAP.

Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
  • Loading branch information
finikorg authored and Gustavo Padovan committed Jul 10, 2012
1 parent 2104786 commit b440067
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ static void l2cap_streaming_send(struct l2cap_chan *chan,

l2cap_do_send(chan, skb);

BT_DBG("Sent txseq %d", (int)control->txseq);
BT_DBG("Sent txseq %u", control->txseq);

chan->next_tx_seq = __next_seq(chan, chan->next_tx_seq);
chan->frames_sent++;
Expand Down Expand Up @@ -1722,11 +1722,11 @@ static int l2cap_ertm_send(struct l2cap_chan *chan)
chan->tx_send_head = skb_queue_next(&chan->tx_q, skb);

l2cap_do_send(chan, tx_skb);
BT_DBG("Sent txseq %d", (int)control->txseq);
BT_DBG("Sent txseq %u", control->txseq);
}

BT_DBG("Sent %d, %d unacked, %d in ERTM queue", sent,
(int) chan->unacked_frames, skb_queue_len(&chan->tx_q));
BT_DBG("Sent %d, %u unacked, %u in ERTM queue", sent,
chan->unacked_frames, skb_queue_len(&chan->tx_q));

return sent;
}
Expand Down Expand Up @@ -1884,7 +1884,7 @@ static void l2cap_send_ack(struct l2cap_chan *chan)
threshold += threshold << 1;
threshold >>= 2;

BT_DBG("frames_to_ack %d, threshold %d", (int)frames_to_ack,
BT_DBG("frames_to_ack %u, threshold %d", frames_to_ack,
threshold);

if (frames_to_ack >= threshold) {
Expand Down Expand Up @@ -1946,15 +1946,15 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan,
}

static struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan,
struct msghdr *msg, size_t len,
u32 priority)
struct msghdr *msg, size_t len,
u32 priority)
{
struct l2cap_conn *conn = chan->conn;
struct sk_buff *skb;
int err, count, hlen = L2CAP_HDR_SIZE + L2CAP_PSMLEN_SIZE;
struct l2cap_hdr *lh;

BT_DBG("chan %p len %d priority %u", chan, (int)len, priority);
BT_DBG("chan %p len %zu priority %u", chan, len, priority);

count = min_t(unsigned int, (conn->mtu - hlen), len);

Expand All @@ -1980,15 +1980,15 @@ static struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan,
}

static struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan,
struct msghdr *msg, size_t len,
u32 priority)
struct msghdr *msg, size_t len,
u32 priority)
{
struct l2cap_conn *conn = chan->conn;
struct sk_buff *skb;
int err, count;
struct l2cap_hdr *lh;

BT_DBG("chan %p len %d", chan, (int)len);
BT_DBG("chan %p len %zu", chan, len);

count = min_t(unsigned int, (conn->mtu - L2CAP_HDR_SIZE), len);

Expand All @@ -2013,15 +2013,15 @@ static struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan,
}

static struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan,
struct msghdr *msg, size_t len,
u16 sdulen)
struct msghdr *msg, size_t len,
u16 sdulen)
{
struct l2cap_conn *conn = chan->conn;
struct sk_buff *skb;
int err, count, hlen;
struct l2cap_hdr *lh;

BT_DBG("chan %p len %d", chan, (int)len);
BT_DBG("chan %p len %zu", chan, len);

if (!conn)
return ERR_PTR(-ENOTCONN);
Expand Down Expand Up @@ -2075,7 +2075,7 @@ static int l2cap_segment_sdu(struct l2cap_chan *chan,
size_t pdu_len;
u8 sar;

BT_DBG("chan %p, msg %p, len %d", chan, msg, (int)len);
BT_DBG("chan %p, msg %p, len %zu", chan, msg, len);

/* It is critical that ERTM PDUs fit in a single HCI fragment,
* so fragmented skbs are not used. The HCI layer's handling
Expand Down Expand Up @@ -2219,7 +2219,7 @@ static void l2cap_send_srej(struct l2cap_chan *chan, u16 txseq)
struct l2cap_ctrl control;
u16 seq;

BT_DBG("chan %p, txseq %d", chan, txseq);
BT_DBG("chan %p, txseq %u", chan, txseq);

memset(&control, 0, sizeof(control));
control.sframe = 1;
Expand Down Expand Up @@ -2259,7 +2259,7 @@ static void l2cap_send_srej_list(struct l2cap_chan *chan, u16 txseq)
u16 initial_head;
u16 seq;

BT_DBG("chan %p, txseq %d", chan, txseq);
BT_DBG("chan %p, txseq %u", chan, txseq);

memset(&control, 0, sizeof(control));
control.sframe = 1;
Expand All @@ -2284,12 +2284,12 @@ static void l2cap_process_reqseq(struct l2cap_chan *chan, u16 reqseq)
struct sk_buff *acked_skb;
u16 ackseq;

BT_DBG("chan %p, reqseq %d", chan, reqseq);
BT_DBG("chan %p, reqseq %u", chan, reqseq);

if (chan->unacked_frames == 0 || reqseq == chan->expected_ack_seq)
return;

BT_DBG("expected_ack_seq %d, unacked_frames %d",
BT_DBG("expected_ack_seq %u, unacked_frames %u",
chan->expected_ack_seq, chan->unacked_frames);

for (ackseq = chan->expected_ack_seq; ackseq != reqseq;
Expand All @@ -2308,7 +2308,7 @@ static void l2cap_process_reqseq(struct l2cap_chan *chan, u16 reqseq)
if (chan->unacked_frames == 0)
__clear_retrans_timer(chan);

BT_DBG("unacked_frames %d", (int) chan->unacked_frames);
BT_DBG("unacked_frames %u", chan->unacked_frames);
}

static void l2cap_abort_rx_srej_sent(struct l2cap_chan *chan)
Expand Down Expand Up @@ -2534,16 +2534,16 @@ static void l2cap_raw_recv(struct l2cap_conn *conn, struct sk_buff *skb)
}

/* ---- L2CAP signalling commands ---- */
static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn,
u8 code, u8 ident, u16 dlen, void *data)
static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, u8 code,
u8 ident, u16 dlen, void *data)
{
struct sk_buff *skb, **frag;
struct l2cap_cmd_hdr *cmd;
struct l2cap_hdr *lh;
int len, count;

BT_DBG("conn %p, code 0x%2.2x, ident 0x%2.2x, len %d",
conn, code, ident, dlen);
BT_DBG("conn %p, code 0x%2.2x, ident 0x%2.2x, len %u",
conn, code, ident, dlen);

len = L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE + dlen;
count = min_t(unsigned int, conn->mtu, len);
Expand Down Expand Up @@ -2626,15 +2626,15 @@ static inline int l2cap_get_conf_opt(void **ptr, int *type, int *olen, unsigned
break;
}

BT_DBG("type 0x%2.2x len %d val 0x%lx", *type, opt->len, *val);
BT_DBG("type 0x%2.2x len %u val 0x%lx", *type, opt->len, *val);
return len;
}

static void l2cap_add_conf_opt(void **ptr, u8 type, u8 len, unsigned long val)
{
struct l2cap_conf_opt *opt = *ptr;

BT_DBG("type 0x%2.2x len %d val 0x%lx", type, len, val);
BT_DBG("type 0x%2.2x len %u val 0x%lx", type, len, val);

opt->type = type;
opt->len = len;
Expand Down

0 comments on commit b440067

Please sign in to comment.