linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
To: Vinicius Costa Gomes <vcgomes@gmail.com>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ] mgmtops: Fix calling btd_adapter_start() for an off adapter
Date: Fri, 6 Jul 2012 17:24:21 -0300	[thread overview]
Message-ID: <20120706202421.GA3084@echo> (raw)
In-Reply-To: <20120706200412.GA17578@x220.spectrum.wifi>

Hi Johan,

On 21:04 Fri 06 Jul, Johan Hedberg wrote:
> Hi Vinicius,
> 
> On Fri, Jul 06, 2012, Vinicius Costa Gomes wrote:
> > When the adapter mode is off and the controller is down, we should
> > not consider that the adapter is powered up.
> > ---
> >  plugins/mgmtops.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
> > index c060ada..4c86389 100644
> > --- a/plugins/mgmtops.c
> > +++ b/plugins/mgmtops.c
> > @@ -1074,7 +1074,7 @@ static void read_info_complete(int sk, uint16_t index, void *buf, size_t len)
> >  
> >  	if (mode != MODE_OFF && !mgmt_powered(info->current_settings))
> >  		mgmt_set_powered(index, TRUE);
> > -	else {
> > +	else if (mode != MODE_OFF) {
> >  		get_connections(sk, index);
> >  		btd_adapter_start(adapter);
> >  	}
> 
> Thanks for catching this, but I think the following would be even more
> clear:
> 
> 	if (mode != MODE_OFF) {
> 		if (mgmt_powered(info->current_settings)) {
> 			get_connections(sk, index);
> 			btd_adapter_start(adapter);
> 		} else
> 			mgmt_set_powered(index, TRUE);
> 	}
> 
> Could you please resend a patch with this logic (assuming you agree)?

Yeah, I agree. Patch coming in a few moments.

> 
> Johan


Cheers,
-- 
Vinicius

      reply	other threads:[~2012-07-06 20:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06 18:47 [PATCH BlueZ] mgmtops: Fix calling btd_adapter_start() for an off adapter Vinicius Costa Gomes
2012-07-06 20:04 ` Johan Hedberg
2012-07-06 20:24   ` Vinicius Costa Gomes [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=20120706202421.GA3084@echo \
    --to=vinicius.gomes@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=vcgomes@gmail.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).