From: Johan Hedberg Date: Fri, 31 Jan 2014 03:39:58 +0000 (-0800) Subject: Bluetooth: Make LTK key type check more readable X-Git-Tag: v5.15~17544^2~11^2~7^2~45^2~256 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21b93b75ad1090dd9aed69b56292648bac6666a9;p=platform%2Fkernel%2Flinux-starfive.git Bluetooth: Make LTK key type check more readable Instead of magic bitwise operations simply compare with the two possible type values that we are interested in. Signed-off-by: Johan Hedberg Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 8094a41..754a59079 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2717,7 +2717,7 @@ int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type, if (!new_key) return 0; - if (type & HCI_SMP_LTK) + if (type == HCI_SMP_LTK || type == HCI_SMP_LTK_SLAVE) mgmt_new_ltk(hdev, key, 1); return 0;