linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH_v2 1/7] android/health: Fix queue creation for mdeps and devices
Date: Sat, 21 Jun 2014 15:32:44 +0200	[thread overview]
Message-ID: <1814869.P8mjeKbRhZ@leonov> (raw)
In-Reply-To: <1403267016-28422-2-git-send-email-ravikumar.veeramally@linux.intel.com>

Hi Ravi,

On Friday 20 of June 2014 15:23:30 Ravi kumar Veeramally wrote:
> Create queue for mdeps, devices and channels when creating app
> and device struct. It is simpler to read code than on demand
> creation.
> ---
>  android/health.c | 33 +++++++++++++--------------------
>  1 file changed, 13 insertions(+), 20 deletions(-)
> 
> diff --git a/android/health.c b/android/health.c
> index 0462e99..7553467 100644
> --- a/android/health.c
> +++ b/android/health.c
> @@ -678,6 +678,14 @@ static struct health_app *create_health_app(const char
> *app_name, goto fail;
>  	}
> 
> +	app->mdeps = queue_new();
> +	if (!app->mdeps)
> +		goto fail;
> +
> +	app->devices = queue_new();
> +	if (!app->devices)
> +		goto fail;
> +
>  	return app;
> 
>  fail:
> @@ -784,14 +792,6 @@ static void bt_health_mdep_cfg_data(const void *buf,
> uint16_t len) memcpy(mdep->descr, cmd->descr, cmd->descr_len);
>  	}
> 
> -	if (app->num_of_mdep > 0 && !app->mdeps) {
> -		app->mdeps = queue_new();
> -		if (!app->mdeps) {
> -			status = HAL_STATUS_FAILED;
> -			goto fail;
> -		}
> -	}
> -
>  	if (!queue_push_tail(app->mdeps, mdep)) {
>  		status = HAL_STATUS_FAILED;
>  		goto fail;
> @@ -1102,6 +1102,11 @@ static struct health_device *create_device(uint16_t
> app_id, const uint8_t *addr)
> 
>  	android2bdaddr(addr, &dev->dst);
>  	dev->app_id = app_id;
> +	dev->channels = queue_new();
> +	if (!dev->channels) {
> +		free_health_device(dev);
> +		return NULL;
> +	}
> 
>  	return dev;
>  }
> @@ -1159,21 +1164,9 @@ static void bt_health_connect_channel(const void
> *buf, uint16_t len)
> 
>  	channel->dev = dev;
> 
> -	if (!app->devices) {
> -		app->devices = queue_new();
> -		if (!app->devices)
> -			goto fail;
> -	}
> -
>  	if (!queue_push_tail(app->devices, dev))
>  		goto fail;
> 
> -	if (!dev->channels) {
> -		dev->channels = queue_new();
> -		if (!dev->channels)
> -			goto fail;
> -	}
> -
>  	if (!queue_push_tail(dev->channels, channel)) {
>  		queue_remove(app->devices, dev);
>  		goto fail;

This patch is now applied, thanks.

-- 
BR
Szymon Janc

  reply	other threads:[~2014-06-21 13:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 12:23 [PATCH_v2 0/7] Initial implementation for MCAP data channel Ravi kumar Veeramally
2014-06-20 12:23 ` [PATCH_v2 1/7] android/health: Fix queue creation for mdeps and devices Ravi kumar Veeramally
2014-06-21 13:32   ` Szymon Janc [this message]
2014-06-20 12:23 ` [PATCH_v2 2/7] android/health: Check if device and channel already exists or not Ravi kumar Veeramally
2014-06-21 13:49   ` Szymon Janc
2014-06-22 11:06     ` Ravi kumar Veeramally
2014-06-20 12:23 ` [PATCH_v2 3/7] android/health: Cache remote mdep id on channel connect request Ravi kumar Veeramally
2014-06-20 12:23 ` [PATCH_v2 4/7] android/health: Notify channel status on channel destroy call Ravi kumar Veeramally
2014-06-20 12:23 ` [PATCH_v2 5/7] android/health: Create and connect MDL Ravi kumar Veeramally
2014-06-21 20:19   ` Szymon Janc
2014-06-22 11:08     ` Ravi kumar Veeramally
2014-06-20 12:23 ` [PATCH_v2 6/7] android/health: Implement mcap_mdl_deleted_cb Ravi kumar Veeramally
2014-06-20 12:23 ` [PATCH_v2 7/7] anrdroid/client/health: Cache fd and close on channel disconnection Ravi kumar Veeramally
2014-06-21  8:40   ` Sebastian Chlad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1814869.P8mjeKbRhZ@leonov \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=ravikumar.veeramally@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).