Discussion:
[PATCH 1/1 net-next] Bluetooth: fix shadow warning in hci_disconnect()
Fabian Frederick
2014-10-23 16:22:45 UTC
Permalink
use cpr for hci_cp_read_clock_offset instead of cp
(already defined above).

Signed-off-by: Fabian Frederick <***@skynet.be>
---
net/bluetooth/hci_conn.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index b9517bd..6151e09 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -141,10 +141,10 @@ int hci_disconnect(struct hci_conn *conn, __u8 reason)
*/
if (conn->type == ACL_LINK && conn->role == HCI_ROLE_MASTER) {
struct hci_dev *hdev = conn->hdev;
- struct hci_cp_read_clock_offset cp;
+ struct hci_cp_read_clock_offset cpr;

- cp.handle = cpu_to_le16(conn->handle);
- hci_send_cmd(hdev, HCI_OP_READ_CLOCK_OFFSET, sizeof(cp), &cp);
+ cpr.handle = cpu_to_le16(conn->handle);
+ hci_send_cmd(hdev, HCI_OP_READ_CLOCK_OFFSET, sizeof(cpr), &cpr);
}

conn->state = BT_DISCONN;
--
1.9.3
Marcel Holtmann
2014-10-23 16:29:08 UTC
Permalink
Hi Fabian,
Post by Fabian Frederick
use cpr for hci_cp_read_clock_offset instead of cp
(already defined above).
---
net/bluetooth/hci_conn.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index b9517bd..6151e09 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -141,10 +141,10 @@ int hci_disconnect(struct hci_conn *conn, __u8 reason)
*/
if (conn->type == ACL_LINK && conn->role == HCI_ROLE_MASTER) {
struct hci_dev *hdev = conn->hdev;
- struct hci_cp_read_clock_offset cp;
+ struct hci_cp_read_clock_offset cpr;
- cp.handle = cpu_to_le16(conn->handle);
- hci_send_cmd(hdev, HCI_OP_READ_CLOCK_OFFSET, sizeof(cp), &cp);
+ cpr.handle = cpu_to_le16(conn->handle);
+ hci_send_cmd(hdev, HCI_OP_READ_CLOCK_OFFSET, sizeof(cpr), &cpr);
valid change, but I do not like cpr as variable name. We need to come up with a better one. There are other places in the code where we had the same thing. Please have a look there.

Regards

Marcel
Fabian Frederick
2014-10-23 17:30:53 UTC
Permalink
Post by Marcel Holtmann
Hi Fabian,
Post by Fabian Frederick
use cpr for hci_cp_read_clock_offset instead of cp
(already defined above).
---
net/bluetooth/hci_conn.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index b9517bd..6151e09 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -141,10 +141,10 @@ int hci_disconnect(struct hci_conn *conn, __u=
8 reason)
Post by Marcel Holtmann
Post by Fabian Frederick
=C2=A0 =C2=A0 =C2=A0 */
=C2=A0 =C2=A0 =C2=A0if (conn->type =3D=3D ACL_LINK && conn->role =3D=
=3D HCI_ROLE_MASTER) {
Post by Marcel Holtmann
Post by Fabian Frederick
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct hci_dev *hdev=
=3D conn->hdev;
Post by Marcel Holtmann
Post by Fabian Frederick
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct hci_cp_read_clock_=
offset cp;
Post by Marcel Holtmann
Post by Fabian Frederick
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct hci_cp_read_clock_=
offset cpr;
Post by Marcel Holtmann
Post by Fabian Frederick
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cp.handle =3D cpu_to_le16=
(conn->handle);
Post by Marcel Holtmann
Post by Fabian Frederick
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0hci_send_cmd(hdev, HCI_OP=
_READ_CLOCK_OFFSET, sizeof(cp), &cp);
Post by Marcel Holtmann
Post by Fabian Frederick
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cpr.handle =3D cpu_to_le1=
6(conn->handle);
Post by Marcel Holtmann
Post by Fabian Frederick
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0hci_send_cmd(hdev, HCI_OP=
_READ_CLOCK_OFFSET, sizeof(cpr), &cpr);
Post by Marcel Holtmann
valid change, but I do not like cpr as variable name. We need to come=
up with
Post by Marcel Holtmann
a better one. There are other places in the code where we had the sam=
e thing.
Post by Marcel Holtmann
Please have a look there.
Regards
Marcel
Hi Marcel,

=C2=A0 Maybe read_cp (like commit c1f23a2bfc89 with struct hci_cp_auth_=
requested
auth_cp) ?

Regards,
=46abian

Loading...