[PATCH BlueZ 1/3] shared/att: Use queue_remove_if

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

This make use of queue_remove_if instead of queue_find + queue_remove
whenever possible.
---
 src/shared/att.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/shared/att.c b/src/shared/att.c
index 447863d..ba3d204 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -978,12 +978,11 @@ bool bt_att_unregister_disconnect(struct bt_att *att, unsigned int id)
 	if (!att || !id)
 		return false;
 
-	disconn = queue_find(att->disconn_list, match_disconn_id,
+	disconn = queue_remove_if(att->disconn_list, match_disconn_id,
 							UINT_TO_PTR(id));
 	if (!disconn)
 		return false;
 
-	queue_remove(att->disconn_list, disconn);
 	destroy_att_disconn(disconn);
 	return true;
 }
@@ -1196,12 +1195,11 @@ bool bt_att_unregister(struct bt_att *att, unsigned int id)
 	if (!att || !id)
 		return false;
 
-	notify = queue_find(att->notify_list, match_notify_id,
+	notify = queue_remove_if(att->notify_list, match_notify_id,
 							UINT_TO_PTR(id));
 	if (!notify)
 		return false;
 
-	queue_remove(att->notify_list, notify);
 	destroy_att_notify(notify);
 	return true;
 }
-- 
1.9.3

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




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux