From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Szymon Janc To: Marcel Holtmann Cc: "linux-bluetooth@vger.kernel.org development" Subject: Re: [PATCH 4/5] android/hal-bluetooth: Add support for device service record property Date: Fri, 20 Dec 2013 15:00:42 +0100 Message-ID: <16521451.7FJGnSNeBd@uw000953> In-Reply-To: References: <1387535140-6223-1-git-send-email-szymon.janc@tieto.com> <3121104.trYEc2PX04@uw000953> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" List-ID: Hi Marcel, > Hi Szymon, > > >>> This allows to correctly handle device service record property. > >>> --- > >>> android/hal-bluetooth.c | 15 +++++++++++++++ > >>> android/hal-msg.h | 7 +++++++ > >>> 2 files changed, 22 insertions(+) > >>> > >>> diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c > >>> index d0c1c01..4ef2ebe 100644 > >>> --- a/android/hal-bluetooth.c > >>> +++ b/android/hal-bluetooth.c > >>> @@ -166,6 +166,21 @@ static void device_props_to_hal(bt_property_t *send_props, > >>> break; > >>> #endif > >>> case HAL_PROP_DEVICE_SERVICE_REC: > >>> + { > >>> + static bt_service_record_t e; > >> > >> why static here. Since we are essentially multi-threaded, this can be dangerous. > > > > This is executed only in notification thread context, so not multi-threading here. > > (yes, commit message could be better) > > and what is wrong with having it on the stack. This function is used to convert from what we get on IPC to HAL, so that data needs to be also accessible outside of this function scope (so Java can copy it). Since we won't get more than 1 prop of each type in single notification this is safe and allows for simpler code. -- BR Szymon Janc