[PATCH BlueZ 3/3] shared/gatt-client: 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/gatt-client.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index e523085..27aef44 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -2414,7 +2414,7 @@ bool bt_gatt_client_unregister_notify(struct bt_gatt_client *client,
 	if (!client || !id)
 		return false;
 
-	notify_data = queue_find(client->notify_list, match_notify_data_id,
+	notify_data = queue_remove_if(client->notify_list, match_notify_data_id,
 							UINT_TO_PTR(id));
 	if (!notify_data)
 		return false;
@@ -2422,7 +2422,6 @@ bool bt_gatt_client_unregister_notify(struct bt_gatt_client *client,
 	assert(notify_data->chrc->notify_count > 0);
 	assert(!notify_data->chrc->ccc_write_id);
 
-	queue_remove(client->notify_list, notify_data);
 	complete_unregister_notify(notify_data);
 	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