diff mbox series

[1/2] bluetooth: hci_event: consolidate error paths in hci_phy_link_complete_evt()

Message ID b508265e-f08f-ea24-2815-bc2a5ec10d8d@omprussia.ru (mailing list archive)
State Not Applicable
Headers show
Series bluetooth: hci_event: make coding style more consistent | expand

Commit Message

Sergey Shtylyov Oct. 7, 2020, 3:54 p.m. UTC
hci_phy_link_complete_evt() has several duplicate error paths -- consolidate
them, using the *goto* statements.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>

---
 net/bluetooth/hci_event.c |   16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

Comments

Marcel Holtmann Nov. 11, 2020, 11:12 a.m. UTC | #1
Hi Sergey,

> hci_phy_link_complete_evt() has several duplicate error paths -- consolidate
> them, using the *goto* statements.
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
> 
> ---
> net/bluetooth/hci_event.c |   16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel
Sergey Shtylyov Nov. 12, 2020, 9:02 a.m. UTC | #2
Hello!

On 11.11.2020 14:12, Marcel Holtmann wrote:

>> hci_phy_link_complete_evt() has several duplicate error paths -- consolidate
>> them, using the *goto* statements.
>>
>> Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
>>
>> ---
>> net/bluetooth/hci_event.c |   16 ++++++----------
>> 1 file changed, 6 insertions(+), 10 deletions(-)
> 
> patch has been applied to bluetooth-next tree.

    What about the 2nd patch?

> Regards
> 
> Marcel

MBR, Sergey
Marcel Holtmann Nov. 23, 2020, 11:58 a.m. UTC | #3
Hi Sergey,

>>> hci_phy_link_complete_evt() has several duplicate error paths -- consolidate
>>> them, using the *goto* statements.
>>> 
>>> Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
>>> 
>>> ---
>>> net/bluetooth/hci_event.c |   16 ++++++----------
>>> 1 file changed, 6 insertions(+), 10 deletions(-)
>> patch has been applied to bluetooth-next tree.
> 
>   What about the 2nd patch?

must have been slipping somehow. Can you please re-send against bluetooth-next.

Regards

Marcel
Sergey Shtylyov Jan. 23, 2021, 5:47 p.m. UTC | #4
On 11/23/20 2:58 PM, Marcel Holtmann wrote:

>>>> hci_phy_link_complete_evt() has several duplicate error paths -- consolidate
>>>> them, using the *goto* statements.
>>>>
>>>> Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
>>>>
>>>> ---
>>>> net/bluetooth/hci_event.c |   16 ++++++----------
>>>> 1 file changed, 6 insertions(+), 10 deletions(-)
>>> patch has been applied to bluetooth-next tree.
>>
>>   What about the 2nd patch?
> 
> must have been slipping somehow. Can you please re-send against bluetooth-next.

   I have but to no avail -- the patch has been silently ignored...

> Regards
> 
> Marcel

MBR, Sergei
diff mbox series

Patch

Index: bluetooth-next/net/bluetooth/hci_event.c
===================================================================
--- bluetooth-next.orig/net/bluetooth/hci_event.c
+++ bluetooth-next/net/bluetooth/hci_event.c
@@ -4936,20 +4936,15 @@  static void hci_phy_link_complete_evt(st
 	hci_dev_lock(hdev);
 
 	hcon = hci_conn_hash_lookup_handle(hdev, ev->phy_handle);
-	if (!hcon) {
-		hci_dev_unlock(hdev);
-		return;
-	}
+	if (!hcon)
+		goto unlock;
 
-	if (!hcon->amp_mgr) {
-		hci_dev_unlock(hdev);
-		return;
-	}
+	if (!hcon->amp_mgr)
+		goto unlock;
 
 	if (ev->status) {
 		hci_conn_del(hcon);
-		hci_dev_unlock(hdev);
-		return;
+		goto unlock;
 	}
 
 	bredr_hcon = hcon->amp_mgr->l2cap_conn->hcon;
@@ -4966,6 +4961,7 @@  static void hci_phy_link_complete_evt(st
 
 	amp_physical_cfm(bredr_hcon, hcon);
 
+unlock:
 	hci_dev_unlock(hdev);
 }