From bed5472cabd47ee9ddc017e7262c4e018cf4ae94 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 28 Nov 2017 17:31:20 +0200 Subject: [PATCH] Bluetooth: Mesh: Remove unnecessary variable Most places in bt_mesh_friend_req() used rx->sub (which is already quite short in itself), so just remove the only remaining user and the helper variable itself. Signed-off-by: Johan Hedberg --- subsys/bluetooth/host/mesh/friend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/host/mesh/friend.c b/subsys/bluetooth/host/mesh/friend.c index 0ed971b189b..6f0b4acadc7 100644 --- a/subsys/bluetooth/host/mesh/friend.c +++ b/subsys/bluetooth/host/mesh/friend.c @@ -787,7 +787,6 @@ static s32_t offer_delay(struct bt_mesh_friend *frnd, s8_t rssi, u8_t crit) int bt_mesh_friend_req(struct bt_mesh_net_rx *rx, struct net_buf_simple *buf) { struct bt_mesh_ctl_friend_req *msg = (void *)buf->data; - struct bt_mesh_subnet *sub = rx->sub; struct bt_mesh_friend *frnd = NULL; u16_t old_friend; u32_t poll_to; @@ -876,7 +875,8 @@ init_friend: k_delayed_work_submit(&frnd->timer, offer_delay(frnd, rx->rssi, msg->criteria)); - friend_cred_create(sub, frnd->lpn, frnd->lpn_counter, frnd->counter); + friend_cred_create(rx->sub, frnd->lpn, frnd->lpn_counter, + frnd->counter); enqueue_offer(frnd, rx->rssi);