Re: [RFC v2 04/16] HoG: discover all characteristics declaration

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

Hi João,

2012/4/18 João Paulo Rechi Vita <jprvita@xxxxxxxxxxxxx>:
> +static void report_free(struct report *report)
> +{
> +       g_free(report->decl);
> +       g_free(report);
> +}

We usually avoid casts (like you do later on the g_slist_free_full()
call), by having:

static void report_free(void *data)
        struct report *report = data;

> @@ -153,6 +203,7 @@ int hog_device_register(struct btd_device *device, const char *path)
>  static void hog_device_free(struct hog_device *hogdev)
>  {
>        btd_device_unref(hogdev->device);
> +       g_slist_free_full(hogdev->reports, (GDestroyNotify) report_free);

You can then drop the cast above.

>        g_free(hogdev->path);
>        g_free(hogdev->hog_primary);
>        g_free(hogdev);

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

[Bluez Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Bluez Devel]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]

Add to Google Powered by Linux