Re: [PATCH BlueZ v3 12/27] device: Use btd_service to represent profiles

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

 



Hi Anderson,

On Fri, Apr 26, 2013 at 1:48 PM, Anderson Lizardo
<anderson.lizardo@xxxxxxxxxxxxx> wrote:
> Hi Mikel,
>
> On Fri, Apr 26, 2013 at 2:17 AM, Mikel Astiz <mikel.astiz.oss@xxxxxxxxx> wrote:
>> +static GSList *find_service_with_profile(GSList *list, struct btd_profile *p)
>> +{
>> +       GSList *l;
>> +
>> +       for (l = list; l != NULL; l = g_slist_next(l)) {
>> +               struct btd_service *service = l->data;
>> +
>> +               if (btd_service_get_profile(service) == p)
>> +                       return l;
>
> Why you don't return service directly here? It should avoid the caller
> having to do "service = l->data;".

The patch has already been applied, but please go ahead with the
review since there's been a lot of code being changed, and testing was
fairly limited due to lack of hardware.

The purpose of this was to be able to delete the node more efficiently
in case that's the intention of the caller, but it's certainly of
little use considering that it's a singly-linked list.

Feel free to submit a patch to simplify this, or otherwise I'll
consider this for a later cleanup patchset.

>
> Another option: you could try using g_slist_find_custom() on the
> callers and turn this into a comparison callback for it.

Johan preferred this approach over find_custom() in a very similar
scenario, so I changed this one as well for consistency.

Cheers,
Mikel
--
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