From: Johan Hedberg <johan.hedberg@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>, linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 3/6] Bluetooth: Fix sending unnecessary HCI_LE_Host_Enable
Date: Thu, 25 Oct 2012 18:14:30 +0300 [thread overview]
Message-ID: <20121025151430.GA6105@x220> (raw)
In-Reply-To: <1351177676.1785.94.camel@aeonflux>
Hi,
On Thu, Oct 25, 2012, Marcel Holtmann wrote:
> > > From: Johan Hedberg <johan.hedberg@intel.com>
> > >
> > > This patch fixes sending an unnecessary HCI_LE_Host_Enable command if
> > > the command has already been sent as part of the default HCI init
> > > sequence.
> > >
> > > Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> > > ---
> > > net/bluetooth/mgmt.c | 10 ++++++++--
> > > 1 file changed, 8 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> > > index 02dc5f8..03dc176 100644
> > > --- a/net/bluetooth/mgmt.c
> > > +++ b/net/bluetooth/mgmt.c
> > > @@ -2927,8 +2927,14 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
> > > cp.le = 1;
> > > cp.simul = !!lmp_le_br_capable(hdev);
> > >
> > > - hci_send_cmd(hdev, HCI_OP_WRITE_LE_HOST_SUPPORTED,
> > > - sizeof(cp), &cp);
> > > + /* Check first if we already have the right
> > > + * host state (host features set)
> > > + */
> > > + if (cp.le != !!lmp_host_le_capable(hdev) ||
> > > + cp.simul != !!lmp_host_le_br_capable(hdev))
> >
> > Shouldn't the !! be part of the macro itself? Looks we will be using !! always
> > with these macros.
>
> we could do that actually. However I prefer to do that with a separate
> patch.
I was thinking of the same earlier, and yes a separate patch to convert
all of the feature test macros would be the cleanest.
Johan
next prev parent reply other threads:[~2012-10-25 15:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-24 21:09 [PATCH 0/6] Bluetooth: Some fixes and full peripheral role support Johan Hedberg
2012-10-24 21:09 ` [PATCH 1/6] Bluetooth: Fix setting host feature bits for SSP Johan Hedberg
2012-10-24 21:45 ` Marcel Holtmann
2012-10-24 21:09 ` [PATCH 2/6] Bluetooth: Fix sending unnecessary HCI_Write_SSP_Mode command Johan Hedberg
2012-10-24 21:48 ` Marcel Holtmann
2012-10-24 21:09 ` [PATCH 3/6] Bluetooth: Fix sending unnecessary HCI_LE_Host_Enable Johan Hedberg
2012-10-24 21:48 ` Marcel Holtmann
2012-10-25 15:05 ` Gustavo Padovan
2012-10-25 15:07 ` Marcel Holtmann
2012-10-25 15:14 ` Johan Hedberg [this message]
2012-10-25 15:20 ` Gustavo Padovan
2012-10-24 21:09 ` [PATCH 4/6] Bluetooth: Fix unnecessary EIR update during powering on Johan Hedberg
2012-10-24 21:49 ` Marcel Holtmann
2012-10-25 15:08 ` Gustavo Padovan
2012-10-24 21:09 ` [PATCH 5/6] Bluetooth: mgmt: Add support for switching to LE peripheral mode Johan Hedberg
2012-10-24 22:13 ` Vinicius Costa Gomes
2012-10-24 22:36 ` Johan Hedberg
2012-10-25 0:58 ` Vinicius Costa Gomes
2012-10-25 1:54 ` Marcel Holtmann
2012-10-25 4:56 ` Vinicius Costa Gomes
2012-10-25 7:50 ` Johan Hedberg
2012-10-25 10:41 ` Anderson Lizardo
2012-10-25 11:48 ` Johan Hedberg
2012-10-25 12:04 ` Johan Hedberg
2012-10-25 14:31 ` Vinicius Costa Gomes
2012-10-25 15:07 ` Johan Hedberg
2012-10-25 18:48 ` Vinicius Costa Gomes
2012-10-24 21:09 ` [PATCH 6/6] Bluetooth: Add support for setting LE advertising data Johan Hedberg
2012-10-24 21:53 ` [PATCH 0/6] Bluetooth: Some fixes and full peripheral role support Marcel Holtmann
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=20121025151430.GA6105@x220 \
--to=johan.hedberg@gmail.com \
--cc=gustavo@padovan.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
/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).