]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Bluetooth: hci_sync: Fix Opcode prints in bt_dev_dbg/err
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>
Wed, 18 Oct 2023 14:47:35 +0000 (16:47 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 23 Oct 2023 18:05:32 +0000 (11:05 -0700)
Printed Opcodes may be missing leading zeros:

Bluetooth: hci0: Opcode 0x c03 failed: -110

Fix this by always printing leading zeros:

Bluetooth: hci0: Opcode 0x0c03 failed: -110

Fixes: d0b137062b2d ("Bluetooth: hci_sync: Rework init stages")
Fixes: 6a98e3836fa2 ("Bluetooth: Add helper for serialized HCI command execution")
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_sync.c

index c6f57af88bfdca63b03483f20e086b69aedd1d6f..d85a7091a1169d714849aeb4f4c7b6967c8a51c1 100644 (file)
@@ -152,7 +152,7 @@ struct sk_buff *__hci_cmd_sync_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
        struct sk_buff *skb;
        int err = 0;
 
-       bt_dev_dbg(hdev, "Opcode 0x%4x", opcode);
+       bt_dev_dbg(hdev, "Opcode 0x%4.4x", opcode);
 
        hci_req_init(&req, hdev);
 
@@ -248,7 +248,7 @@ int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
        skb = __hci_cmd_sync_sk(hdev, opcode, plen, param, event, timeout, sk);
        if (IS_ERR(skb)) {
                if (!event)
-                       bt_dev_err(hdev, "Opcode 0x%4x failed: %ld", opcode,
+                       bt_dev_err(hdev, "Opcode 0x%4.4x failed: %ld", opcode,
                                   PTR_ERR(skb));
                return PTR_ERR(skb);
        }