Re: [PATCH BlueZ v2 0/3] foreach early termination

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

 



Hi Michael,

On Fri, Dec 12, 2014 at 8:44 PM, Michael Janssen <jamuraa@xxxxxxxxxxxx> wrote:
> This patch set enables the early termination of iteration when using the
> foreach functions provided by gatt_db and queue.  This makes it possible to
> make some iterations more efficient.
>
> v1 -> v2:
>   * Rebase
>   * Minor formatting fixes (thanks Arman)
>
> Michael Janssen (3):
>   shared/queue: enable early terminate foreach
>   unit/test-queue: add test for early termination
>   shared/gatt-db: enable foreach early termination
>
>  android/bluetooth.c      |  4 ++-
>  android/gatt.c           | 48 +++++++++++++++++++----------
>  android/handsfree.c      |  9 ++++--
>  android/health.c         | 36 +++++++++++++---------
>  android/tester-main.c    | 32 ++++++++++++++-----
>  emulator/hciemu.c        |  3 +-
>  monitor/keys.c           | 10 +++---
>  src/shared/att.c         | 22 ++++++++-----
>  src/shared/gatt-client.c | 25 +++++++++------
>  src/shared/gatt-db.c     | 80 +++++++++++++++++++++++++-----------------------
>  src/shared/gatt-db.h     |  2 +-
>  src/shared/hci.c         |  4 ++-
>  src/shared/mgmt.c        |  8 +++--
>  src/shared/queue.c       |  3 +-
>  src/shared/queue.h       |  2 +-
>  src/shared/uhid.c        |  6 ++--
>  tools/btgatt-client.c    | 32 +++++++++++++------
>  tools/btgatt-server.c    | 24 ++++++++++-----
>  unit/test-gatt.c         | 35 ++++++++++++---------
>  unit/test-queue.c        | 44 +++++++++++++++++++++++---
>  20 files changed, 278 insertions(+), 151 deletions(-)
>
> --
> 2.2.0.rc0.207.ga3a616c

Perhaps we should introduce this as a new API, actually looking what
code it touches maybe what we really want is to introduce a manual
iteration API such as ell have l_queue_get_entries:

/**
 * l_queue_get_entries:
 * @queue: queue object
 *
 * This function gives direct, read-only access to the internal list structure
 * of the queue.  This can be used to efficiently traverse the elements.
 *
 * Returns: A pointer to the head of the queue.
 **/
LIB_EXPORT const struct l_queue_entry *l_queue_get_entries(struct
l_queue *queue)

But then we need to make queue_entry public and let the caller control
it manually, this sounds a bit more flexible and should eliminate the
use of done/fail flags.

-- 
Luiz Augusto von Dentz
--
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