Return-Path: MIME-Version: 1.0 In-Reply-To: <1418327617-26951-1-git-send-email-jamuraa@chromium.org> References: <1418327617-26951-1-git-send-email-jamuraa@chromium.org> Date: Fri, 12 Dec 2014 12:11:17 +0200 Message-ID: Subject: Re: [PATCH BlueZ 0/3] foreach early termination From: Luiz Augusto von Dentz To: Michael Janssen Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Michael, On Thu, Dec 11, 2014 at 9:53 PM, Michael Janssen 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. > > 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 | 9 +++--- > src/shared/att.c | 21 ++++++++----- > src/shared/gatt-client.c | 22 +++++++------- > src/shared/gatt-db.c | 76 +++++++++++++++++++++++------------------------- > src/shared/gatt-db.h | 2 +- > src/shared/hci.c | 4 ++- > src/shared/mgmt.c | 13 +++++---- > 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 | 32 ++++++++++---------- > unit/test-queue.c | 33 +++++++++++++++++++-- > 20 files changed, 260 insertions(+), 151 deletions(-) > > -- > 2.2.0.rc0.207.ga3a616c Overall it seems to make sense to have early termination, but I would like to first push my set that make foreach safe from removal/destroy. -- Luiz Augusto von Dentz