Hi Johan, On Fri, Mar 22, 2013 at 11:55 AM, Johan Hedberg <johan.hedberg@xxxxxxxxx> wrote: > Hi Mikel, > > On Tue, Mar 19, 2013, Mikel Astiz wrote: >> +static gint service_profile_cmp(gconstpointer a, gconstpointer b) >> +{ >> + struct btd_service *service = (gpointer) a; >> + struct btd_profile *profile = (gpointer) b; > > Instead of this explicit casting why not declare the local variables > const too? In order to do this (at least in the case of b) I'd have to add a const version of service_get_profile(). However, profile.h doesn't define any semantics for a const profile (and neither does device.h), so I would discourage adding a function such as: struct btd_profile *service_get_profile(const struct btd_service *service); I therefore though it wasn't worth making the API more complex in order to have such a comparison function. If you still want this, a possible alternative would be to extend the API with: const struct btd_profile *service_get_profile_const(const struct btd_service *service); const struct btd_device *service_get_device_const(const struct btd_service *service); 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