Skip to content

Commit

Permalink
Bluetooth: hci_event: Fix build warning with C=1
Browse files Browse the repository at this point in the history
This fixes the following warning when build with make C=1:

net/bluetooth/hci_event.c:337:15: warning: restricted __le16 degrades to integer

Fixes: a936612 ("Bluetooth: Process result of HCI Delete Stored Link Key command")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Luiz Augusto von Dentz committed Aug 9, 2022
1 parent b444342 commit 889f034
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,17 @@ static u8 hci_cc_delete_stored_link_key(struct hci_dev *hdev, void *data,
struct sk_buff *skb)
{
struct hci_rp_delete_stored_link_key *rp = data;
u16 num_keys;

bt_dev_dbg(hdev, "status 0x%2.2x", rp->status);

if (rp->status)
return rp->status;

if (rp->num_keys <= hdev->stored_num_keys)
hdev->stored_num_keys -= le16_to_cpu(rp->num_keys);
num_keys = le16_to_cpu(rp->num_keys);

if (num_keys <= hdev->stored_num_keys)
hdev->stored_num_keys -= num_keys;
else
hdev->stored_num_keys = 0;

Expand Down

0 comments on commit 889f034

Please sign in to comment.