Bluetooth: Remove unnecessary hcon->smp_conn variable
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 27 Jun 2014 11:23:07 +0000 (14:23 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 3 Jul 2014 15:42:47 +0000 (17:42 +0200)
The smp_conn member of struct hci_conn was simply a pointer to the
l2cap_conn object. Since we already have hcon->l2cap_data that points to
the same thing there's no need to have this second variable. This patch
removes it and changes the single place that was using it to use
hcon->l2cap_data instead.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci_core.h
net/bluetooth/smp.c

index dda7f00c07c5b012a676e57f1b2a270881eb1f99..ca2a99807615f8151d95237e79a4040c2f67e109 100644 (file)
@@ -409,7 +409,6 @@ struct hci_conn {
        struct hci_dev  *hdev;
        void            *l2cap_data;
        void            *sco_data;
-       void            *smp_conn;
        struct amp_mgr  *amp_mgr;
 
        struct hci_conn *link;
index 641ce8b69d2a430d5c63e0b231671043fd4d1bc6..414c5151aa461d3bf75b60309411e96840783325 100644 (file)
@@ -584,7 +584,6 @@ static struct smp_chan *smp_chan_create(struct l2cap_conn *conn)
 
        smp->conn = conn;
        conn->smp_chan = smp;
-       conn->hcon->smp_conn = conn;
 
        hci_conn_hold(conn->hcon);
 
@@ -626,13 +625,12 @@ void smp_chan_destroy(struct l2cap_conn *conn)
 
        kfree(smp);
        conn->smp_chan = NULL;
-       conn->hcon->smp_conn = NULL;
        hci_conn_drop(conn->hcon);
 }
 
 int smp_user_confirm_reply(struct hci_conn *hcon, u16 mgmt_op, __le32 passkey)
 {
-       struct l2cap_conn *conn = hcon->smp_conn;
+       struct l2cap_conn *conn = hcon->l2cap_data;
        struct smp_chan *smp;
        u32 value;