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 1/3] android/health: Remove mcl instance on mcl_disconnected call back
Date: Mon, 25 Aug 2014 11:39:19 +0200 [thread overview]
Message-ID: <1471101.Hvbh4fLBkX@uw000953> (raw)
In-Reply-To: <1408698607-23815-1-git-send-email-ravikumar.veeramally@linux.intel.com>
Hi Ravi,
On Friday 22 of August 2014 12:10:05 Ravi kumar Veeramally wrote:
> MCAP library is maintaining two sets of mcl list. On mcl_disconnected
> call mcl instance is removed from regular mcl list and cached in mcl_cache
> list. health.c doesn't maintain any cached mcls list. So mcl_conn variable
> doesn't make any sense of not being connected on mcl_disconnected call back.
> So unref mcl on mcl_disconnected and don't do anything in mcl_unached callback.
> ---
> android/health.c | 17 +++--------------
> 1 file changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/android/health.c b/android/health.c
> index 665482e..ee6c11b 100644
> --- a/android/health.c
> +++ b/android/health.c
> @@ -85,7 +85,6 @@ struct health_device {
> uint16_t app_id;
>
> struct mcap_mcl *mcl;
> - bool mcl_conn;
>
> struct queue *channels; /* data channels */
>
> @@ -193,7 +192,6 @@ static void unref_mcl(struct health_device *dev)
> mcap_close_mcl(dev->mcl, FALSE);
> mcap_mcl_unref(dev->mcl);
> dev->mcl = NULL;
> - dev->mcl_conn = false;
> }
>
> static void free_health_device(void *data)
> @@ -1826,7 +1824,6 @@ static void create_mcl_cb(struct mcap_mcl *mcl, GError *err, gpointer data)
> if (!channel->dev->mcl)
> channel->dev->mcl = mcap_mcl_ref(mcl);
>
> - channel->dev->mcl_conn = true;
> info("health: MCL connected");
>
> ret = set_mcl_cb(channel->dev->mcl, channel, &gerr);
> @@ -1948,7 +1945,7 @@ static void bt_health_connect_channel(const void *buf, uint16_t len)
> }
> }
>
> - if (!dev->mcl || (dev->mcl && !dev->mcl_conn)) {
> + if (!dev->mcl) {
> if (connect_mcl(channel) < 0) {
> error("health: error retrieving HDP SDP record");
> goto fail;
> @@ -2072,8 +2069,6 @@ static void mcl_reconnected(struct mcap_mcl *mcl, gpointer data)
> error("device data does not exists");
> return;
> }
> -
> - dev->mcl_conn = true;
> }
>
> static void mcl_disconnected(struct mcap_mcl *mcl, gpointer data)
> @@ -2084,18 +2079,12 @@ static void mcl_disconnected(struct mcap_mcl *mcl, gpointer data)
>
> info("health: MCL disconnected");
> dev = search_dev_by_mcl(mcl);
> - if (dev)
> - dev->mcl_conn = false;
> + unref_mcl(dev);
> }
>
> static void mcl_uncached(struct mcap_mcl *mcl, gpointer data)
> {
> - struct health_device *dev;
> -
> - DBG("");
> -
> - dev = search_dev_by_mcl(mcl);
> - free_health_device(dev);
> + /* mcap library maintains cache of mcls, not required here */
> }
>
> bool bt_health_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
>
This patch is now applied, thanks.
I had to fix commit message line length limit, so please keep it 72 characters
in future.
--
Best regards,
Szymon Janc
prev parent reply other threads:[~2014-08-25 9:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 9:10 [PATCH 1/3] android/health: Remove mcl instance on mcl_disconnected call back Ravi kumar Veeramally
2014-08-22 9:10 ` [PATCH 2/3] android/health: Call MDL shutdown after mdl_deleted_cb callback Ravi kumar Veeramally
2014-08-25 9:49 ` Szymon Janc
2014-08-22 9:10 ` [PATCH 3/3] android/health: Cache MDL file desciptor Ravi kumar Veeramally
2014-08-25 9:56 ` Szymon Janc
2014-08-25 9:39 ` Szymon Janc [this message]
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=1471101.Hvbh4fLBkX@uw000953 \
--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