2021-06-03 07:46:45

by yekai (A)

[permalink] [raw]
Subject: [PATCH v3 00/12] Bluetooth: correct the use of print format

According to Documentation/core-api/printk-formats.rst,
Use the correct print format.
1. Printing an unsigned int value should use %u instead of %d.
2. Printing an unsigned long value should use %lu instead of %ld.
Otherwise printk() might end up displaying negative numbers.

changes v1 -> v2:
fix some style problems
changes v2 -> v3
fix some commit message style

Kai Ye (12):
Bluetooth: bnep: Use the correct print format
Bluetooth: cmtp: Use the correct print format
Bluetooth: hidp: Use the correct print format
Bluetooth: rfcomm: Use the correct print format
Bluetooth: 6lowpan: Use the correct print format
Bluetooth: a2mp: Use the correct print format
Bluetooth: amp: Use the correct print format
Bluetooth: hci: Use the correct print format
Bluetooth: mgmt: Use the correct print format
Bluetooth: msft: Use the correct print format
Bluetooth: sco: Use the correct print format
Bluetooth: smp: Use the correct print format

net/bluetooth/6lowpan.c | 16 +++++------
net/bluetooth/a2mp.c | 24 ++++++++--------
net/bluetooth/amp.c | 6 ++--
net/bluetooth/bnep/core.c | 8 +++---
net/bluetooth/cmtp/capi.c | 22 +++++++--------
net/bluetooth/hci_conn.c | 8 +++---
net/bluetooth/hci_core.c | 48 ++++++++++++++++----------------
net/bluetooth/hci_event.c | 24 ++++++++--------
net/bluetooth/hci_request.c | 8 +++---
net/bluetooth/hci_sock.c | 6 ++--
net/bluetooth/hci_sysfs.c | 2 +-
net/bluetooth/hidp/core.c | 6 ++--
net/bluetooth/mgmt.c | 16 +++++------
net/bluetooth/mgmt_config.c | 4 +--
net/bluetooth/msft.c | 2 +-
net/bluetooth/rfcomm/core.c | 68 ++++++++++++++++++++++-----------------------
net/bluetooth/rfcomm/sock.c | 8 +++---
net/bluetooth/rfcomm/tty.c | 10 +++----
net/bluetooth/sco.c | 8 +++---
net/bluetooth/smp.c | 6 ++--
20 files changed, 150 insertions(+), 150 deletions(-)

--
2.8.1


2021-06-03 07:46:55

by yekai (A)

[permalink] [raw]
Subject: [PATCH v3 05/12] Bluetooth: 6lowpan: Use the correct print format

According to Documentation/core-api/printk-formats.rst,
Use the correct print format. Printing an unsigned int value should use %u
instead of %d. Otherwise printk() might end up displaying negative numbers.

Signed-off-by: Kai Ye <[email protected]>
---
net/bluetooth/6lowpan.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index cff4944..8de7876 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -195,7 +195,7 @@ static inline struct lowpan_peer *peer_lookup_dst(struct lowpan_btle_dev *dev,
rcu_read_lock();

list_for_each_entry_rcu(peer, &dev->peers, list) {
- BT_DBG("dst addr %pMR dst type %d ip %pI6c",
+ BT_DBG("dst addr %pMR dst type %u ip %pI6c",
&peer->chan->dst, peer->chan->dst_type,
&peer->peer_addr);

@@ -507,7 +507,7 @@ static int send_mcast_pkt(struct sk_buff *skb, struct net_device *netdev)

local_skb = skb_clone(skb, GFP_ATOMIC);

- BT_DBG("xmit %s to %pMR type %d IP %pI6c chan %p",
+ BT_DBG("xmit %s to %pMR type %u IP %pI6c chan %p",
netdev->name,
&pentry->chan->dst, pentry->chan->dst_type,
&pentry->peer_addr, pentry->chan);
@@ -550,7 +550,7 @@ static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev)

if (err) {
if (lowpan_cb(skb)->chan) {
- BT_DBG("xmit %s to %pMR type %d IP %pI6c chan %p",
+ BT_DBG("xmit %s to %pMR type %u IP %pI6c chan %p",
netdev->name, &addr, addr_type,
&lowpan_cb(skb)->addr, lowpan_cb(skb)->chan);
err = send_pkt(lowpan_cb(skb)->chan, skb, netdev);
@@ -819,7 +819,7 @@ static void chan_close_cb(struct l2cap_chan *chan)

BT_DBG("dev %p removing %speer %p", dev,
last ? "last " : "1 ", peer);
- BT_DBG("chan %p orig refcnt %d", chan,
+ BT_DBG("chan %p orig refcnt %u", chan,
kref_read(&chan->kref));

l2cap_chan_put(chan);
@@ -943,7 +943,7 @@ static int bt_6lowpan_disconnect(struct l2cap_conn *conn, u8 dst_type)
{
struct lowpan_peer *peer;

- BT_DBG("conn %p dst type %d", conn, dst_type);
+ BT_DBG("conn %p dst type %u", conn, dst_type);

peer = lookup_peer(conn);
if (!peer)
@@ -975,7 +975,7 @@ static struct l2cap_chan *bt_6lowpan_listen(void)

atomic_set(&chan->nesting, L2CAP_NESTING_PARENT);

- BT_DBG("chan %p src type %d", chan, chan->src_type);
+ BT_DBG("chan %p src type %u", chan, chan->src_type);

err = l2cap_add_psm(chan, addr, cpu_to_le16(L2CAP_PSM_IPSP));
if (err) {
@@ -1016,7 +1016,7 @@ static int get_l2cap_conn(char *buf, bdaddr_t *addr, u8 *addr_type,

*conn = (struct l2cap_conn *)hcon->l2cap_data;

- BT_DBG("conn %p dst %pMR type %d", *conn, &hcon->dst, hcon->dst_type);
+ BT_DBG("conn %p dst %pMR type %u", *conn, &hcon->dst, hcon->dst_type);

return 0;
}
@@ -1158,7 +1158,7 @@ static ssize_t lowpan_control_write(struct file *fp,
return -EALREADY;
}

- BT_DBG("conn %p dst %pMR type %d user %d", conn,
+ BT_DBG("conn %p dst %pMR type %d user %u", conn,
&conn->hcon->dst, conn->hcon->dst_type,
addr_type);
}
--
2.8.1

2021-06-03 07:46:57

by yekai (A)

[permalink] [raw]
Subject: [PATCH v3 01/12] Bluetooth: bnep: Use the correct print format

According to Documentation/core-api/printk-formats.rst,
Use the correct print format. Printing an unsigned int value should use %u
instead of %d. Otherwise printk() might end up displaying negative numbers.

Signed-off-by: Kai Ye <[email protected]>
---
net/bluetooth/bnep/core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 43c2841..72f47b3 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -126,8 +126,8 @@ static int bnep_ctrl_set_netfilter(struct bnep_session *s, __be16 *data, int len
f[i].start = get_unaligned_be16(data++);
f[i].end = get_unaligned_be16(data++);

- BT_DBG("proto filter start %d end %d",
- f[i].start, f[i].end);
+ BT_DBG("proto filter start %u end %u",
+ f[i].start, f[i].end);
}

if (i < BNEP_MAX_PROTO_FILTERS)
@@ -266,7 +266,7 @@ static int bnep_rx_extension(struct bnep_session *s, struct sk_buff *skb)
break;
}

- BT_DBG("type 0x%x len %d", h->type, h->len);
+ BT_DBG("type 0x%x len %u", h->type, h->len);

switch (h->type & BNEP_TYPE_MASK) {
case BNEP_EXT_CONTROL:
@@ -424,7 +424,7 @@ static int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
int len = 0, il = 0;
u8 type = 0;

- BT_DBG("skb %p dev %p type %d", skb, skb->dev, skb->pkt_type);
+ BT_DBG("skb %p dev %p type %u", skb, skb->dev, skb->pkt_type);

if (!skb->dev) {
/* Control frame sent by us */
--
2.8.1

2021-06-03 07:47:01

by yekai (A)

[permalink] [raw]
Subject: [PATCH v3 10/12] Bluetooth: msft: Use the correct print format

According to Documentation/core-api/printk-formats.rst,
Use the correct print format. Printing an unsigned int value should use %u
instead of %d. Otherwise printk() might end up displaying negative numbers.

Signed-off-by: Kai Ye <[email protected]>
---
net/bluetooth/msft.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c
index 47b104f..8d2310e 100644
--- a/net/bluetooth/msft.c
+++ b/net/bluetooth/msft.c
@@ -308,7 +308,7 @@ static void msft_le_monitor_advertisement_cb(struct hci_dev *hdev,

monitor = idr_find(&hdev->adv_monitors_idr, msft->pending_add_handle);
if (!monitor) {
- bt_dev_err(hdev, "msft add advmon: monitor %d is not found!",
+ bt_dev_err(hdev, "msft add advmon: monitor %u is not found!",
msft->pending_add_handle);
status = HCI_ERROR_UNSPECIFIED;
goto unlock;
--
2.8.1

2021-06-03 07:47:38

by yekai (A)

[permalink] [raw]
Subject: [PATCH v3 09/12] Bluetooth: mgmt: Use the correct print format

According to Documentation/core-api/printk-formats.rst,
Use the correct print format. Printing an unsigned int value should use %u
instead of %d. Otherwise printk() might end up displaying negative numbers.

Signed-off-by: Kai Ye <[email protected]>
---
net/bluetooth/mgmt.c | 16 ++++++++--------
net/bluetooth/mgmt_config.c | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 51c7e64..efdec6c 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -4269,7 +4269,7 @@ int mgmt_add_adv_patterns_monitor_complete(struct hci_dev *hdev, u8 status)

done:
hci_dev_unlock(hdev);
- bt_dev_dbg(hdev, "add monitor %d complete, status %d",
+ bt_dev_dbg(hdev, "add monitor %d complete, status %u",
rp.monitor_handle, status);

return err;
@@ -4494,7 +4494,7 @@ int mgmt_remove_adv_monitor_complete(struct hci_dev *hdev, u8 status)

done:
hci_dev_unlock(hdev);
- bt_dev_dbg(hdev, "remove monitor %d complete, status %d",
+ bt_dev_dbg(hdev, "remove monitor %d complete, status %u",
rp.monitor_handle, status);

return err;
@@ -4824,7 +4824,7 @@ void mgmt_start_discovery_complete(struct hci_dev *hdev, u8 status)
{
struct mgmt_pending_cmd *cmd;

- bt_dev_dbg(hdev, "status %d", status);
+ bt_dev_dbg(hdev, "status %u", status);

hci_dev_lock(hdev);

@@ -5080,7 +5080,7 @@ void mgmt_stop_discovery_complete(struct hci_dev *hdev, u8 status)
{
struct mgmt_pending_cmd *cmd;

- bt_dev_dbg(hdev, "status %d", status);
+ bt_dev_dbg(hdev, "status %u", status);

hci_dev_lock(hdev);

@@ -5293,7 +5293,7 @@ static int set_device_id(struct sock *sk, struct hci_dev *hdev, void *data,
static void enable_advertising_instance(struct hci_dev *hdev, u8 status,
u16 opcode)
{
- bt_dev_dbg(hdev, "status %d", status);
+ bt_dev_dbg(hdev, "status %u", status);
}

static void set_advertising_complete(struct hci_dev *hdev, u8 status,
@@ -6337,7 +6337,7 @@ static void conn_info_refresh_complete(struct hci_dev *hdev, u8 hci_status,
handle = __le16_to_cpu(cp->handle);
conn = hci_conn_hash_lookup_handle(hdev, handle);
if (!conn) {
- bt_dev_err(hdev, "unknown handle (%d) in conn_info response",
+ bt_dev_err(hdev, "unknown handle (%u) in conn_info response",
handle);
goto unlock;
}
@@ -7641,7 +7641,7 @@ static void add_advertising_complete(struct hci_dev *hdev, u8 status,
struct adv_info *adv_instance, *n;
u8 instance;

- bt_dev_dbg(hdev, "status %d", status);
+ bt_dev_dbg(hdev, "status %u", status);

hci_dev_lock(hdev);

@@ -8172,7 +8172,7 @@ static void remove_advertising_complete(struct hci_dev *hdev, u8 status,
struct mgmt_cp_remove_advertising *cp;
struct mgmt_rp_remove_advertising rp;

- bt_dev_dbg(hdev, "status %d", status);
+ bt_dev_dbg(hdev, "status %u", status);

hci_dev_lock(hdev);

diff --git a/net/bluetooth/mgmt_config.c b/net/bluetooth/mgmt_config.c
index 1deb0ca..6ef701c 100644
--- a/net/bluetooth/mgmt_config.c
+++ b/net/bluetooth/mgmt_config.c
@@ -146,7 +146,7 @@ int set_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
const u16 type = le16_to_cpu(TO_TLV(buffer)->type);

if (buffer_left < exp_len) {
- bt_dev_warn(hdev, "invalid len left %d, exp >= %d",
+ bt_dev_warn(hdev, "invalid len left %u, exp >= %u",
buffer_left, exp_len);

return mgmt_cmd_status(sk, hdev->id,
@@ -198,7 +198,7 @@ int set_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
}

if (exp_type_len && len != exp_type_len) {
- bt_dev_warn(hdev, "invalid length %d, exp %zu for type %d",
+ bt_dev_warn(hdev, "invalid length %d, exp %zu for type %u",
len, exp_type_len, type);

return mgmt_cmd_status(sk, hdev->id,
--
2.8.1

2021-06-03 07:47:39

by yekai (A)

[permalink] [raw]
Subject: [PATCH v3 12/12] Bluetooth: smp: Use the correct print format

According to Documentation/core-api/printk-formats.rst,
Use the correct print format. Printing an unsigned int value should use %u
instead of %d. Otherwise printk() might end up displaying negative numbers.

Signed-off-by: Kai Ye <[email protected]>
---
net/bluetooth/smp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 2def906..56c59f8 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -859,7 +859,7 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth,
memset(smp->tk, 0, sizeof(smp->tk));
clear_bit(SMP_FLAG_TK_VALID, &smp->flags);

- bt_dev_dbg(hcon->hdev, "auth:%d lcl:%d rem:%d", auth, local_io,
+ bt_dev_dbg(hcon->hdev, "auth:%u lcl:%u rem:%u", auth, local_io,
remote_io);

/* If neither side wants MITM, either "just" confirm an incoming
@@ -925,7 +925,7 @@ static int tk_request(struct l2cap_conn *conn, u8 remote_oob, u8 auth,
get_random_bytes(&passkey, sizeof(passkey));
passkey %= 1000000;
put_unaligned_le32(passkey, smp->tk);
- bt_dev_dbg(hcon->hdev, "PassKey: %d", passkey);
+ bt_dev_dbg(hcon->hdev, "PassKey: %u", passkey);
set_bit(SMP_FLAG_TK_VALID, &smp->flags);
}

@@ -1654,7 +1654,7 @@ int smp_user_confirm_reply(struct hci_conn *hcon, u16 mgmt_op, __le32 passkey)
case MGMT_OP_USER_PASSKEY_REPLY:
value = le32_to_cpu(passkey);
memset(smp->tk, 0, sizeof(smp->tk));
- bt_dev_dbg(conn->hcon->hdev, "PassKey: %d", value);
+ bt_dev_dbg(conn->hcon->hdev, "PassKey: %u", value);
put_unaligned_le32(value, smp->tk);
fallthrough;
case MGMT_OP_USER_CONFIRM_REPLY:
--
2.8.1

2021-06-03 07:47:41

by yekai (A)

[permalink] [raw]
Subject: [PATCH v3 04/12] Bluetooth: rfcomm: Use the correct print format

According to Documentation/core-api/printk-formats.rst,
Use the correct print format. Printing an unsigned int value should use %u
instead of %d. Otherwise printk() might end up displaying negative numbers.
And fix the correct local variables type that been used.

Signed-off-by: Kai Ye <[email protected]>
---
net/bluetooth/rfcomm/core.c | 68 ++++++++++++++++++++++-----------------------
net/bluetooth/rfcomm/sock.c | 8 +++---
net/bluetooth/rfcomm/tty.c | 10 +++----
3 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index f2bacb4..eec8fdc 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -338,7 +338,7 @@ static void rfcomm_dlc_unlink(struct rfcomm_dlc *d)
{
struct rfcomm_session *s = d->session;

- BT_DBG("dlc %p refcnt %d session %p", d, refcount_read(&d->refcnt), s);
+ BT_DBG("dlc %p refcnt %u session %p", d, refcount_read(&d->refcnt), s);

list_del(&d->list);
d->session = NULL;
@@ -370,7 +370,7 @@ static int __rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
int err = 0;
u8 dlci;

- BT_DBG("dlc %p state %ld %pMR -> %pMR channel %d",
+ BT_DBG("dlc %p state %lu %pMR -> %pMR channel %u",
d, d->state, src, dst, channel);

if (rfcomm_check_channel(channel))
@@ -450,8 +450,8 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
if (!s)
return 0;

- BT_DBG("dlc %p state %ld dlci %d err %d session %p",
- d, d->state, d->dlci, err, s);
+ BT_DBG("dlc %p state %lu dlci %u err %d session %p",
+ d, d->state, d->dlci, err, s);

switch (d->state) {
case BT_CONNECT:
@@ -502,7 +502,7 @@ int rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
struct rfcomm_dlc *d_list;
struct rfcomm_session *s, *s_list;

- BT_DBG("dlc %p state %ld dlci %d err %d", d, d->state, d->dlci, err);
+ BT_DBG("dlc %p state %lu dlci %u err %d", d, d->state, d->dlci, err);

rfcomm_lock();

@@ -551,12 +551,12 @@ struct rfcomm_dlc *rfcomm_dlc_exists(bdaddr_t *src, bdaddr_t *dst, u8 channel)

int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb)
{
- int len = skb->len;
+ unsigned int len = skb->len;

if (d->state != BT_CONNECTED)
return -ENOTCONN;

- BT_DBG("dlc %p mtu %d len %d", d, d->mtu, len);
+ BT_DBG("dlc %p mtu %u len %u", d, d->mtu, len);

if (len > d->mtu)
return -EINVAL;
@@ -571,9 +571,9 @@ int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb)

void rfcomm_dlc_send_noerror(struct rfcomm_dlc *d, struct sk_buff *skb)
{
- int len = skb->len;
+ unsigned int len = skb->len;

- BT_DBG("dlc %p mtu %d len %d", d, d->mtu, len);
+ BT_DBG("dlc %p mtu %u len %u", d, d->mtu, len);

rfcomm_make_uih(skb, d->addr);
skb_queue_tail(&d->tx_queue, skb);
@@ -826,7 +826,7 @@ static int rfcomm_send_ua(struct rfcomm_session *s, u8 dlci)
{
struct rfcomm_cmd cmd;

- BT_DBG("%p dlci %d", s, dlci);
+ BT_DBG("%p dlci %u", s, dlci);

cmd.addr = __addr(!s->initiator, dlci);
cmd.ctrl = __ctrl(RFCOMM_UA, 1);
@@ -840,7 +840,7 @@ static int rfcomm_send_disc(struct rfcomm_session *s, u8 dlci)
{
struct rfcomm_cmd cmd;

- BT_DBG("%p dlci %d", s, dlci);
+ BT_DBG("%p dlci %u", s, dlci);

cmd.addr = __addr(s->initiator, dlci);
cmd.ctrl = __ctrl(RFCOMM_DISC, 1);
@@ -855,7 +855,7 @@ static int rfcomm_queue_disc(struct rfcomm_dlc *d)
struct rfcomm_cmd *cmd;
struct sk_buff *skb;

- BT_DBG("dlc %p dlci %d", d, d->dlci);
+ BT_DBG("dlc %p dlci %u", d, d->dlci);

skb = alloc_skb(sizeof(*cmd), GFP_KERNEL);
if (!skb)
@@ -876,7 +876,7 @@ static int rfcomm_send_dm(struct rfcomm_session *s, u8 dlci)
{
struct rfcomm_cmd cmd;

- BT_DBG("%p dlci %d", s, dlci);
+ BT_DBG("%p dlci %u", s, dlci);

cmd.addr = __addr(!s->initiator, dlci);
cmd.ctrl = __ctrl(RFCOMM_DM, 1);
@@ -892,7 +892,7 @@ static int rfcomm_send_nsc(struct rfcomm_session *s, int cr, u8 type)
struct rfcomm_mcc *mcc;
u8 buf[16], *ptr = buf;

- BT_DBG("%p cr %d type %d", s, cr, type);
+ BT_DBG("%p cr %d type %u", s, cr, type);

hdr = (void *) ptr; ptr += sizeof(*hdr);
hdr->addr = __addr(s->initiator, 0);
@@ -918,7 +918,7 @@ static int rfcomm_send_pn(struct rfcomm_session *s, int cr, struct rfcomm_dlc *d
struct rfcomm_pn *pn;
u8 buf[16], *ptr = buf;

- BT_DBG("%p cr %d dlci %d mtu %d", s, cr, d->dlci, d->mtu);
+ BT_DBG("%p cr %d dlci %u mtu %u", s, cr, d->dlci, d->mtu);

hdr = (void *) ptr; ptr += sizeof(*hdr);
hdr->addr = __addr(s->initiator, 0);
@@ -963,7 +963,7 @@ int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci,
struct rfcomm_rpn *rpn;
u8 buf[16], *ptr = buf;

- BT_DBG("%p cr %d dlci %d bit_r 0x%x data_b 0x%x stop_b 0x%x parity 0x%x"
+ BT_DBG("%p cr %d dlci %u bit_r 0x%x data_b 0x%x stop_b 0x%x parity 0x%x"
" flwc_s 0x%x xon_c 0x%x xoff_c 0x%x p_mask 0x%x",
s, cr, dlci, bit_rate, data_bits, stop_bits, parity,
flow_ctrl_settings, xon_char, xoff_char, param_mask);
@@ -998,7 +998,7 @@ static int rfcomm_send_rls(struct rfcomm_session *s, int cr, u8 dlci, u8 status)
struct rfcomm_rls *rls;
u8 buf[16], *ptr = buf;

- BT_DBG("%p cr %d status 0x%x", s, cr, status);
+ BT_DBG("%p cr %u status 0x%x", s, cr, status);

hdr = (void *) ptr; ptr += sizeof(*hdr);
hdr->addr = __addr(s->initiator, 0);
@@ -1025,7 +1025,7 @@ static int rfcomm_send_msc(struct rfcomm_session *s, int cr, u8 dlci, u8 v24_sig
struct rfcomm_msc *msc;
u8 buf[16], *ptr = buf;

- BT_DBG("%p cr %d v24 0x%x", s, cr, v24_sig);
+ BT_DBG("%p cr %u v24 0x%x", s, cr, v24_sig);

hdr = (void *) ptr; ptr += sizeof(*hdr);
hdr->addr = __addr(s->initiator, 0);
@@ -1126,7 +1126,7 @@ static int rfcomm_send_credits(struct rfcomm_session *s, u8 addr, u8 credits)
struct rfcomm_hdr *hdr;
u8 buf[16], *ptr = buf;

- BT_DBG("%p addr %d credits %d", s, addr, credits);
+ BT_DBG("%p addr %u credits %u", s, addr, credits);

hdr = (void *) ptr; ptr += sizeof(*hdr);
hdr->addr = addr;
@@ -1163,7 +1163,7 @@ static void rfcomm_make_uih(struct sk_buff *skb, u8 addr)
/* ---- RFCOMM frame reception ---- */
static struct rfcomm_session *rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci)
{
- BT_DBG("session %p state %ld dlci %d", s, s->state, dlci);
+ BT_DBG("session %p state %ld dlci %u", s, s->state, dlci);

if (dlci) {
/* Data channel */
@@ -1217,7 +1217,7 @@ static struct rfcomm_session *rfcomm_recv_dm(struct rfcomm_session *s, u8 dlci)
{
int err = 0;

- BT_DBG("session %p state %ld dlci %d", s, s->state, dlci);
+ BT_DBG("session %p state %ld dlci %u", s, s->state, dlci);

if (dlci) {
/* Data DLC */
@@ -1247,7 +1247,7 @@ static struct rfcomm_session *rfcomm_recv_disc(struct rfcomm_session *s,
{
int err = 0;

- BT_DBG("session %p state %ld dlci %d", s, s->state, dlci);
+ BT_DBG("session %p state %ld dlci %u", s, s->state, dlci);

if (dlci) {
struct rfcomm_dlc *d = rfcomm_dlc_get(s, dlci);
@@ -1323,7 +1323,7 @@ static int rfcomm_recv_sabm(struct rfcomm_session *s, u8 dlci)
struct rfcomm_dlc *d;
u8 channel;

- BT_DBG("session %p state %ld dlci %d", s, s->state, dlci);
+ BT_DBG("session %p state %ld dlci %u", s, s->state, dlci);

if (!dlci) {
rfcomm_send_ua(s, 0);
@@ -1364,8 +1364,8 @@ static int rfcomm_apply_pn(struct rfcomm_dlc *d, int cr, struct rfcomm_pn *pn)
{
struct rfcomm_session *s = d->session;

- BT_DBG("dlc %p state %ld dlci %d mtu %d fc 0x%x credits %d",
- d, d->state, d->dlci, pn->mtu, pn->flow_ctrl, pn->credits);
+ BT_DBG("dlc %p state %lu dlci %u mtu %u fc 0x%x credits %u",
+ d, d->state, d->dlci, pn->mtu, pn->flow_ctrl, pn->credits);

if ((pn->flow_ctrl == 0xf0 && s->cfc != RFCOMM_CFC_DISABLED) ||
pn->flow_ctrl == 0xe0) {
@@ -1395,7 +1395,7 @@ static int rfcomm_recv_pn(struct rfcomm_session *s, int cr, struct sk_buff *skb)
struct rfcomm_dlc *d;
u8 dlci = pn->dlci;

- BT_DBG("session %p state %ld dlci %d", s, s->state, dlci);
+ BT_DBG("session %p state %lu dlci %u", s, s->state, dlci);

if (!dlci)
return 0;
@@ -1552,7 +1552,7 @@ static int rfcomm_recv_rls(struct rfcomm_session *s, int cr, struct sk_buff *skb
struct rfcomm_rls *rls = (void *) skb->data;
u8 dlci = __get_dlci(rls->dlci);

- BT_DBG("dlci %d cr %d status 0x%x", dlci, cr, rls->status);
+ BT_DBG("dlci %u cr %d status 0x%x", dlci, cr, rls->status);

if (!cr)
return 0;
@@ -1572,7 +1572,7 @@ static int rfcomm_recv_msc(struct rfcomm_session *s, int cr, struct sk_buff *skb
struct rfcomm_dlc *d;
u8 dlci = __get_dlci(msc->dlci);

- BT_DBG("dlci %d cr %d v24 0x%x", dlci, cr, msc->v24_sig);
+ BT_DBG("dlci %u cr %d v24 0x%x", dlci, cr, msc->v24_sig);

d = rfcomm_dlc_get(s, dlci);
if (!d)
@@ -1611,7 +1611,7 @@ static int rfcomm_recv_mcc(struct rfcomm_session *s, struct sk_buff *skb)
type = __get_mcc_type(mcc->type);
len = __get_mcc_len(mcc->len);

- BT_DBG("%p type 0x%x cr %d", s, type, cr);
+ BT_DBG("%p type 0x%x cr %u", s, type, cr);

skb_pull(skb, 2);

@@ -1666,7 +1666,7 @@ static int rfcomm_recv_data(struct rfcomm_session *s, u8 dlci, int pf, struct sk
{
struct rfcomm_dlc *d;

- BT_DBG("session %p state %ld dlci %d pf %d", s, s->state, dlci, pf);
+ BT_DBG("session %p state %lu dlci %u pf %d", s, s->state, dlci, pf);

d = rfcomm_dlc_get(s, dlci);
if (!d) {
@@ -1790,8 +1790,8 @@ static int rfcomm_process_tx(struct rfcomm_dlc *d)
struct sk_buff *skb;
int err;

- BT_DBG("dlc %p state %ld cfc %d rx_credits %d tx_credits %d",
- d, d->state, d->cfc, d->rx_credits, d->tx_credits);
+ BT_DBG("dlc %p state %lu cfc %u rx_credits %u tx_credits %u",
+ d, d->state, d->cfc, d->rx_credits, d->tx_credits);

/* Send pending MSC */
if (test_and_clear_bit(RFCOMM_MSC_PENDING, &d->flags))
@@ -1896,7 +1896,7 @@ static struct rfcomm_session *rfcomm_process_rx(struct rfcomm_session *s)
struct sock *sk = sock->sk;
struct sk_buff *skb;

- BT_DBG("session %p state %ld qlen %d", s, s->state, skb_queue_len(&sk->sk_receive_queue));
+ BT_DBG("session %p state %lu qlen %u", s, s->state, skb_queue_len(&sk->sk_receive_queue));

/* Get data directly from socket receive queue without copying it. */
while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
@@ -2153,7 +2153,7 @@ static int rfcomm_dlc_debugfs_show(struct seq_file *f, void *x)
struct l2cap_chan *chan = l2cap_pi(s->sock->sk)->chan;
struct rfcomm_dlc *d;
list_for_each_entry(d, &s->dlcs, list) {
- seq_printf(f, "%pMR %pMR %ld %d %d %d %d\n",
+ seq_printf(f, "%pMR %pMR %lu %u %u %u %u\n",
&chan->src, &chan->dst,
d->state, d->dlci, d->mtu,
d->rx_credits, d->tx_credits);
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index ae6f807..4c4081e 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -194,7 +194,7 @@ static void rfcomm_sock_kill(struct sock *sk)
if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket)
return;

- BT_DBG("sk %p state %d refcnt %d", sk, sk->sk_state, refcount_read(&sk->sk_refcnt));
+ BT_DBG("sk %p state %d refcnt %u", sk, sk->sk_state, refcount_read(&sk->sk_refcnt));

/* Kill poor orphan */
bt_sock_unlink(&rfcomm_sk_list, sk);
@@ -965,7 +965,7 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc *
bdaddr_t src, dst;
int result = 0;

- BT_DBG("session %p channel %d", s, channel);
+ BT_DBG("session %p channel %u", s, channel);

rfcomm_session_getaddr(s, &src, &dst);

@@ -978,7 +978,7 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc *

/* Check for backlog size */
if (sk_acceptq_is_full(parent)) {
- BT_DBG("backlog full %d", parent->sk_ack_backlog);
+ BT_DBG("backlog full %u", parent->sk_ack_backlog);
goto done;
}

@@ -1016,7 +1016,7 @@ static int rfcomm_sock_debugfs_show(struct seq_file *f, void *p)
read_lock(&rfcomm_sk_list.lock);

sk_for_each(sk, &rfcomm_sk_list.head) {
- seq_printf(f, "%pMR %pMR %d %d\n",
+ seq_printf(f, "%pMR %pMR %d %u\n",
&rfcomm_pi(sk)->src, &rfcomm_pi(sk)->dst,
sk->sk_state, rfcomm_pi(sk)->channel);
}
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index a585849..eeae373 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -207,7 +207,7 @@ static ssize_t show_address(struct device *tty_dev, struct device_attribute *att
static ssize_t show_channel(struct device *tty_dev, struct device_attribute *attr, char *buf)
{
struct rfcomm_dev *dev = dev_get_drvdata(tty_dev);
- return sprintf(buf, "%d\n", dev->channel);
+ return sprintf(buf, "%u\n", dev->channel);
}

static DEVICE_ATTR(address, 0444, show_address, NULL);
@@ -319,7 +319,7 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
struct rfcomm_dev *dev;
struct device *tty;

- BT_DBG("id %d channel %d", req->dev_id, req->channel);
+ BT_DBG("id %d channel %u", req->dev_id, req->channel);

dev = __rfcomm_dev_add(req, dlc);
if (IS_ERR(dev)) {
@@ -579,7 +579,7 @@ static int rfcomm_get_dev_info(void __user *arg)

int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
{
- BT_DBG("cmd %d arg %p", cmd, arg);
+ BT_DBG("cmd %u arg %p", cmd, arg);

switch (cmd) {
case RFCOMMCREATEDEV:
@@ -613,7 +613,7 @@ static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb)
return;
}

- BT_DBG("dlc %p len %d", dlc, skb->len);
+ BT_DBG("dlc %p len %u", dlc, skb->len);

tty_insert_flip_string(&dev->port, skb->data, skb->len);
tty_flip_buffer_push(&dev->port);
@@ -749,7 +749,7 @@ static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp)

BT_DBG("tty %p id %d", tty, tty->index);

- BT_DBG("dev %p dst %pMR channel %d opened %d", dev, &dev->dst,
+ BT_DBG("dev %p dst %pMR channel %u opened %d", dev, &dev->dst,
dev->channel, dev->port.count);

err = tty_port_open(&dev->port, tty, filp);
--
2.8.1