From: Kai Ye <yekai13@huawei.com>
To: <marcel@holtmann.org>, <johan.hedberg@gmail.com>,
<luiz.dentz@gmail.com>, <davem@davemloft.net>, <kuba@kernel.org>,
<netdev@vger.kernel.org>, <linux-bluetooth@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <yekai13@huawei.com>
Subject: [PATCH v2 12/12] net/Bluetooth/smp - use the correct print format
Date: Fri, 21 May 2021 13:59:48 +0800 [thread overview]
Message-ID: <1621576788-48092-13-git-send-email-yekai13@huawei.com> (raw)
In-Reply-To: <1621576788-48092-1-git-send-email-yekai13@huawei.com>
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 <yekai13@huawei.com>
---
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
next prev parent reply other threads:[~2021-05-21 6:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 5:59 [PATCH v2 00/12] net/Bluetooth: correct the use of " Kai Ye
2021-05-21 5:59 ` [PATCH v2 01/12] net/Bluetooth/bnep - use the correct " Kai Ye
2021-05-21 5:59 ` [PATCH v2 02/12] net/Bluetooth/cmtp " Kai Ye
2021-05-21 5:59 ` [PATCH v2 03/12] net/Bluetooth/hidp " Kai Ye
2021-05-21 5:59 ` [PATCH v2 04/12] net/Bluetooth/rfcomm " Kai Ye
2021-05-21 5:59 ` [PATCH v2 05/12] net/Bluetooth/6lowpan " Kai Ye
2021-05-21 5:59 ` [PATCH v2 06/12] net/Bluetooth/a2mp " Kai Ye
2021-05-21 5:59 ` [PATCH v2 07/12] net/Bluetooth/amp " Kai Ye
2021-05-21 5:59 ` [PATCH v2 08/12] net/Bluetooth/hci " Kai Ye
2021-05-21 5:59 ` [PATCH v2 09/12] net/Bluetooth/mgmt " Kai Ye
2021-05-21 5:59 ` [PATCH v2 10/12] net/Bluetooth/msft " Kai Ye
2021-05-21 5:59 ` [PATCH v2 11/12] net/Bluetooth/sco " Kai Ye
2021-05-21 5:59 ` Kai Ye [this message]
2021-06-02 20:18 ` [PATCH v2 00/12] net/Bluetooth: correct the use of " Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1621576788-48092-13-git-send-email-yekai13@huawei.com \
--to=yekai13@huawei.com \
--cc=davem@davemloft.net \
--cc=johan.hedberg@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®