Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <yekai13@huawei.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Kai Ye and committed by
Marcel Holtmann
85d67284 610850be

+10 -10
+8 -8
net/bluetooth/mgmt.c
··· 4279 4279 4280 4280 done: 4281 4281 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", 4283 4283 rp.monitor_handle, status); 4284 4284 4285 4285 return err; ··· 4504 4504 4505 4505 done: 4506 4506 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", 4508 4508 rp.monitor_handle, status); 4509 4509 4510 4510 return err; ··· 4834 4834 { 4835 4835 struct mgmt_pending_cmd *cmd; 4836 4836 4837 - bt_dev_dbg(hdev, "status %d", status); 4837 + bt_dev_dbg(hdev, "status %u", status); 4838 4838 4839 4839 hci_dev_lock(hdev); 4840 4840 ··· 5090 5090 { 5091 5091 struct mgmt_pending_cmd *cmd; 5092 5092 5093 - bt_dev_dbg(hdev, "status %d", status); 5093 + bt_dev_dbg(hdev, "status %u", status); 5094 5094 5095 5095 hci_dev_lock(hdev); 5096 5096 ··· 5303 5303 static void enable_advertising_instance(struct hci_dev *hdev, u8 status, 5304 5304 u16 opcode) 5305 5305 { 5306 - bt_dev_dbg(hdev, "status %d", status); 5306 + bt_dev_dbg(hdev, "status %u", status); 5307 5307 } 5308 5308 5309 5309 static void set_advertising_complete(struct hci_dev *hdev, u8 status, ··· 6347 6347 handle = __le16_to_cpu(cp->handle); 6348 6348 conn = hci_conn_hash_lookup_handle(hdev, handle); 6349 6349 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", 6351 6351 handle); 6352 6352 goto unlock; 6353 6353 } ··· 7654 7654 struct adv_info *adv_instance, *n; 7655 7655 u8 instance; 7656 7656 7657 - bt_dev_dbg(hdev, "status %d", status); 7657 + bt_dev_dbg(hdev, "status %u", status); 7658 7658 7659 7659 hci_dev_lock(hdev); 7660 7660 ··· 8184 8184 struct mgmt_cp_remove_advertising *cp; 8185 8185 struct mgmt_rp_remove_advertising rp; 8186 8186 8187 - bt_dev_dbg(hdev, "status %d", status); 8187 + bt_dev_dbg(hdev, "status %u", status); 8188 8188 8189 8189 hci_dev_lock(hdev); 8190 8190
+2 -2
net/bluetooth/mgmt_config.c
··· 146 146 const u16 type = le16_to_cpu(TO_TLV(buffer)->type); 147 147 148 148 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", 150 150 buffer_left, exp_len); 151 151 152 152 return mgmt_cmd_status(sk, hdev->id, ··· 198 198 } 199 199 200 200 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", 202 202 len, exp_type_len, type); 203 203 204 204 return mgmt_cmd_status(sk, hdev->id,