diff mbox series

Bluetooth: Don't assign twice the same value

Message ID e2c2fe36c226529c99595370003d3cb1b7133c47.1646252285.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series Bluetooth: Don't assign twice the same value | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Christophe JAILLET March 2, 2022, 8:18 p.m. UTC
data.pid is set twice with the same value. Remove one of these redundant
calls.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 net/bluetooth/l2cap_core.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Luiz Augusto von Dentz March 2, 2022, 9:36 p.m. UTC | #1
Hi Christophe,

On Wed, Mar 2, 2022 at 12:18 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> data.pid is set twice with the same value. Remove one of these redundant
> calls.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  net/bluetooth/l2cap_core.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index e817ff0607a0..0d460cb7f965 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -1443,7 +1443,6 @@ static void l2cap_ecred_connect(struct l2cap_chan *chan)
>         data.pdu.scid[0]     = cpu_to_le16(chan->scid);
>
>         chan->ident = l2cap_get_ident(conn);
> -       data.pid = chan->ops->get_peer_pid(chan);

Perhaps we should do if (!data->pid) then since afaik one can do
connect without bind.

>         data.count = 1;
>         data.chan = chan;
> --
> 2.32.0
>
Christophe JAILLET March 3, 2022, 5:48 a.m. UTC | #2
Le 02/03/2022 à 22:36, Luiz Augusto von Dentz a écrit :
> Hi Christophe,
> 
> On Wed, Mar 2, 2022 at 12:18 PM Christophe JAILLET
> <christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org> wrote:
>>
>> data.pid is set twice with the same value. Remove one of these redundant
>> calls.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
>> ---
>>   net/bluetooth/l2cap_core.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
>> index e817ff0607a0..0d460cb7f965 100644
>> --- a/net/bluetooth/l2cap_core.c
>> +++ b/net/bluetooth/l2cap_core.c
>> @@ -1443,7 +1443,6 @@ static void l2cap_ecred_connect(struct l2cap_chan *chan)
>>          data.pdu.scid[0]     = cpu_to_le16(chan->scid);
>>
>>          chan->ident = l2cap_get_ident(conn);
>> -       data.pid = chan->ops->get_peer_pid(chan);
> 
> Perhaps we should do if (!data->pid) then since afaik one can do
> connect without bind.

Not sure to follow you.
'data' is local to this function. data->pid is undefined at this point.


If your comment is about the end of the function that should be 
conditional, I don't know the bluetooth stack at all and can't have any 
opinion about it.

If it is relevant, s.o. else will need to provide a patch for it.

CJ

> 
>>          data.count = 1;
>>          data.chan = chan;
>> --
>> 2.32.0
>>
> 
>
Luiz Augusto von Dentz March 14, 2022, 10 p.m. UTC | #3
Hi Christophe,

On Wed, Mar 2, 2022 at 12:18 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> data.pid is set twice with the same value. Remove one of these redundant
> calls.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  net/bluetooth/l2cap_core.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index e817ff0607a0..0d460cb7f965 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -1443,7 +1443,6 @@ static void l2cap_ecred_connect(struct l2cap_chan *chan)
>         data.pdu.scid[0]     = cpu_to_le16(chan->scid);
>
>         chan->ident = l2cap_get_ident(conn);
> -       data.pid = chan->ops->get_peer_pid(chan);
>
>         data.count = 1;
>         data.chan = chan;
> --
> 2.32.0
>
Applied, thanks.
diff mbox series

Patch

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index e817ff0607a0..0d460cb7f965 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1443,7 +1443,6 @@  static void l2cap_ecred_connect(struct l2cap_chan *chan)
 	data.pdu.scid[0]     = cpu_to_le16(chan->scid);
 
 	chan->ident = l2cap_get_ident(conn);
-	data.pid = chan->ops->get_peer_pid(chan);
 
 	data.count = 1;
 	data.chan = chan;