From: "Gustavo F. Padovan" <gustavo@padovan.org>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: Move bit-field var to data->flags
Date: Mon, 19 Jul 2010 16:48:53 -0300 [thread overview]
Message-ID: <20100719194853.GA14220@vigoh> (raw)
In-Reply-To: <AANLkTilbCpi-Dt-Pk1w3o7wahMNiAXIweC4xE1Y-skZ3@mail.gmail.com>
Hi Anderson,
* Anderson Lizardo <anderson.lizardo@openbossa.org> [2010-07-19 15:03:33 -0400]:
> On Mon, Jul 19, 2010 at 2:40 PM, Gustavo F. Padovan <gustavo@padovan.org> wrote:
> >> On Fri, Jul 16, 2010 at 4:20 PM, Gustavo F. Padovan <gustavo@padovan.org> wrote:
> >> > @@ -810,7 +810,7 @@ static void btusb_work(struct work_struct *work)
> >> > int err;
> >> >
> >> > if (hdev->conn_hash.sco_num > 0) {
> >> > - if (!data->did_iso_resume) {
> >> > + if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) {
> >> > err = usb_autopm_get_interface(data->isoc);
> >> > if (err < 0) {
> >> > clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
> >> > @@ -818,7 +818,7 @@ static void btusb_work(struct work_struct *work)
> >> > return;
> >> > }
> >> >
> >> > - data->did_iso_resume = 1;
> >> > + set_bit(BTUSB_DID_ISO_RESUME, &data->flags);
> >> > }
> >> > if (data->isoc_altsetting != 2) {
> >> > clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
> >>
> >> Just wondering ... could test_and_set_bit() be used here (instead of
> >> test_bit() + set_bit()) ?
> >
> > No, because usb_autopm_get_interface() can return a error. In that case
> > we shall not set the bit.
>
> Ok, but in this case looks like there is a clear_bit() already there.
No, the clear_bit() clears the BTUSB_ISOC_RUNNING and not
BTUSB_DID_ISO_RESUME that we are talking here.
--
Gustavo F. Padovan
http://padovan.org
prev parent reply other threads:[~2010-07-19 19:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-16 20:20 [PATCH] Bluetooth: Move bit-field var to data->flags Gustavo F. Padovan
2010-07-16 20:54 ` Marcel Holtmann
2010-07-19 17:19 ` Anderson Lizardo
2010-07-19 18:40 ` Gustavo F. Padovan
2010-07-19 19:03 ` Anderson Lizardo
2010-07-19 19:48 ` Gustavo F. Padovan [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=20100719194853.GA14220@vigoh \
--to=gustavo@padovan.org \
--cc=anderson.lizardo@openbossa.org \
--cc=linux-bluetooth@vger.kernel.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).