diff mbox

[1/1,net-next] Bluetooth: fix shadow warning in hci_disconnect()

Message ID 1414081365-6461-1-git-send-email-fabf@skynet.be
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Fabian Frederick Oct. 23, 2014, 4:22 p.m. UTC
use cpr for hci_cp_read_clock_offset instead of cp
(already defined above).

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

Comments

Marcel Holtmann Oct. 23, 2014, 4:29 p.m. UTC | #1
Hi Fabian,

> use cpr for hci_cp_read_clock_offset instead of cp
> (already defined above).
> 
> Signed-off-by: Fabian Frederick <fabf@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);

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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Fabian Frederick Oct. 23, 2014, 5:30 p.m. UTC | #2
> On 23 October 2014 at 18:29 Marcel Holtmann <marcel@holtmann.org> wrote:
>
>
> Hi Fabian,
>
> > use cpr for hci_cp_read_clock_offset instead of cp
> > (already defined above).
> >
> > Signed-off-by: Fabian Frederick <fabf@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);
>
> 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
>

Hi Marcel,

  Maybe read_cp (like commit c1f23a2bfc89 with struct hci_cp_auth_requested
auth_cp) ?

Regards,
Fabian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Marcel Holtmann Oct. 23, 2014, 10:09 p.m. UTC | #3
Hi Fabian,

>>> use cpr for hci_cp_read_clock_offset instead of cp
>>> (already defined above).
>>> 
>>> Signed-off-by: Fabian Frederick <fabf@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);
>> 
>> 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.
> 
>   Maybe read_cp (like commit c1f23a2bfc89 with struct hci_cp_auth_requested
> auth_cp) ?

lets use clkoff_cp unless someone comes up with a better name.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;