Commit 75f7293a authored by YueHaibing's avatar YueHaibing Committed by Marcel Holtmann

Bluetooth: remove set but not used variable 'smp'

Fixes gcc '-Wunused-but-set-variable' warning:

net/bluetooth/smp.c: In function 'smp_irk_matches':
net/bluetooth/smp.c:505:18: warning: variable 'smp' set but not used [-Wunused-but-set-variable]

net/bluetooth/smp.c: In function 'smp_generate_rpa':
net/bluetooth/smp.c:526:18: warning: variable 'smp' set but not used [-Wunused-but-set-variable]

It is not used since commit 28a220aa ("bluetooth: switch
to AES library")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent d9f45ab9
...@@ -502,15 +502,12 @@ bool smp_irk_matches(struct hci_dev *hdev, const u8 irk[16], ...@@ -502,15 +502,12 @@ bool smp_irk_matches(struct hci_dev *hdev, const u8 irk[16],
const bdaddr_t *bdaddr) const bdaddr_t *bdaddr)
{ {
struct l2cap_chan *chan = hdev->smp_data; struct l2cap_chan *chan = hdev->smp_data;
struct smp_dev *smp;
u8 hash[3]; u8 hash[3];
int err; int err;
if (!chan || !chan->data) if (!chan || !chan->data)
return false; return false;
smp = chan->data;
BT_DBG("RPA %pMR IRK %*phN", bdaddr, 16, irk); BT_DBG("RPA %pMR IRK %*phN", bdaddr, 16, irk);
err = smp_ah(irk, &bdaddr->b[3], hash); err = smp_ah(irk, &bdaddr->b[3], hash);
...@@ -523,14 +520,11 @@ bool smp_irk_matches(struct hci_dev *hdev, const u8 irk[16], ...@@ -523,14 +520,11 @@ bool smp_irk_matches(struct hci_dev *hdev, const u8 irk[16],
int smp_generate_rpa(struct hci_dev *hdev, const u8 irk[16], bdaddr_t *rpa) int smp_generate_rpa(struct hci_dev *hdev, const u8 irk[16], bdaddr_t *rpa)
{ {
struct l2cap_chan *chan = hdev->smp_data; struct l2cap_chan *chan = hdev->smp_data;
struct smp_dev *smp;
int err; int err;
if (!chan || !chan->data) if (!chan || !chan->data)
return -EOPNOTSUPP; return -EOPNOTSUPP;
smp = chan->data;
get_random_bytes(&rpa->b[3], 3); get_random_bytes(&rpa->b[3], 3);
rpa->b[5] &= 0x3f; /* Clear two most significant bits */ rpa->b[5] &= 0x3f; /* Clear two most significant bits */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment