Re: [PATCH] adapter: add API to find an existing device by D-Bus path

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

 



2012/8/30  <chen.ganir@ti...>:

> +       for (l = adapter->devices; l != NULL; l = g_slist_next(l))
> +               if (g_strcmp0(device_get_path(l->data), path) == 0)
> +                       break;

what about returning l->data here instead of breaking the loop, so you
don't need the following NULL check?

> +
> +       if (!l)
> +               return NULL;
> +
> +       return l->data;
> +}

-- 
Daniele Forsi
--
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