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 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;".

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

> +       }
> +
> +       return NULL;
> +}

Best Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
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