Skip to content

Commit 85d6728

Browse files
yekai123123holtmann
authored andcommitted
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]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 610850b commit 85d6728

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

net/bluetooth/mgmt.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4279,7 +4279,7 @@ int mgmt_add_adv_patterns_monitor_complete(struct hci_dev *hdev, u8 status)
42794279

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

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

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

45104510
return err;
@@ -4834,7 +4834,7 @@ void mgmt_start_discovery_complete(struct hci_dev *hdev, u8 status)
48344834
{
48354835
struct mgmt_pending_cmd *cmd;
48364836

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

48394839
hci_dev_lock(hdev);
48404840

@@ -5090,7 +5090,7 @@ void mgmt_stop_discovery_complete(struct hci_dev *hdev, u8 status)
50905090
{
50915091
struct mgmt_pending_cmd *cmd;
50925092

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

50955095
hci_dev_lock(hdev);
50965096

@@ -5303,7 +5303,7 @@ static int set_device_id(struct sock *sk, struct hci_dev *hdev, void *data,
53035303
static void enable_advertising_instance(struct hci_dev *hdev, u8 status,
53045304
u16 opcode)
53055305
{
5306-
bt_dev_dbg(hdev, "status %d", status);
5306+
bt_dev_dbg(hdev, "status %u", status);
53075307
}
53085308

53095309
static void set_advertising_complete(struct hci_dev *hdev, u8 status,
@@ -6347,7 +6347,7 @@ static void conn_info_refresh_complete(struct hci_dev *hdev, u8 hci_status,
63476347
handle = __le16_to_cpu(cp->handle);
63486348
conn = hci_conn_hash_lookup_handle(hdev, handle);
63496349
if (!conn) {
6350-
bt_dev_err(hdev, "unknown handle (%d) in conn_info response",
6350+
bt_dev_err(hdev, "unknown handle (%u) in conn_info response",
63516351
handle);
63526352
goto unlock;
63536353
}
@@ -7654,7 +7654,7 @@ static void add_advertising_complete(struct hci_dev *hdev, u8 status,
76547654
struct adv_info *adv_instance, *n;
76557655
u8 instance;
76567656

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

76597659
hci_dev_lock(hdev);
76607660

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

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

81898189
hci_dev_lock(hdev);
81908190

net/bluetooth/mgmt_config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ int set_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
146146
const u16 type = le16_to_cpu(TO_TLV(buffer)->type);
147147

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

152152
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,
198198
}
199199

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

204204
return mgmt_cmd_status(sk, hdev->id,

0 commit comments

Comments
 (0)