]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Bluetooth: MGMT: Fixes build warnings with C=1
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 3 Aug 2022 21:51:16 +0000 (14:51 -0700)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 9 Aug 2022 00:05:45 +0000 (17:05 -0700)
This fixes the following warning when building with make C=1:

net/bluetooth/mgmt.c:3821:29: warning: restricted __le16 degrades to integer
net/bluetooth/mgmt.c:4625:9: warning: cast to restricted __le32

Fixes: c3a6eb622096f ("Bluetooth: Implementation of MGMT_OP_SET_BLOCKED_KEYS.")
Fixes: 0c2100b9202ff ("Bluetooth: Add get/set device flags mgmt op")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/mgmt.c

index 646d10401b806bdeebbeeb6135a8122e601ff737..f0bb2fc883d7c03e2b21286299d43e38af5b6c95 100644 (file)
@@ -3819,7 +3819,7 @@ static int set_blocked_keys(struct sock *sk, struct hci_dev *hdev, void *data,
 
        hci_blocked_keys_clear(hdev);
 
-       for (i = 0; i < keys->key_count; ++i) {
+       for (i = 0; i < key_count; ++i) {
                struct blocked_key *b = kzalloc(sizeof(*b), GFP_KERNEL);
 
                if (!b) {
@@ -4624,8 +4624,7 @@ static int set_device_flags(struct sock *sk, struct hci_dev *hdev, void *data,
        u32 current_flags = __le32_to_cpu(cp->current_flags);
 
        bt_dev_dbg(hdev, "Set device flags %pMR (type 0x%x) = 0x%x",
-                  &cp->addr.bdaddr, cp->addr.type,
-                  __le32_to_cpu(current_flags));
+                  &cp->addr.bdaddr, cp->addr.type, current_flags);
 
        // We should take hci_dev_lock() early, I think.. conn_flags can change
        supported_flags = hdev->conn_flags;