From: Johan Hedberg <johan.hedberg@gmail.com>
To: David Scherba <dscherba@codeaurora.org>
Cc: linux-bluetooth@vger.kernel.org, marcel@holtmann.org,
rshaffer@codeaurora.org
Subject: Re: [PATCH 2/2] Use HCI device type to gate BR/EDR-specific HCI commands
Date: Mon, 9 Aug 2010 17:59:13 -0400 [thread overview]
Message-ID: <20100809215913.GB25488@jh-x301> (raw)
In-Reply-To: <1281388059-15945-3-git-send-email-dscherba@codeaurora.org>
Hi David,
On Mon, Aug 09, 2010, David Scherba wrote:
> +static inline int is_bredr_hci_device_type(uint8_t type)
Could you just call this ignore_device() which combines the AMP and RAW
checks.
> +{
> + return (type >> 4) == HCI_BREDR;
> +}
Looks like the indentation is wrong inside the function (two spaces
instead of a tab).
> - if (hci_test_bit(HCI_RAW, &di.flags))
> + if (!is_bredr_hci_device_type(di.type) ||
> + hci_test_bit(HCI_RAW, &di.flags))
No spaces+tabs mixed indentation please. The second line should be
indented by at least two tabs more than the line above it (as many tabs
as you can as long as the line doesn't go beyond 79 characters). OTOH,
the second line goes away completely if you do the ignore_device
simplification as proposed above.
> - if (!hci_test_bit(HCI_RAW, &di.flags))
> + if (is_bredr_hci_device_type(di.type) &&
> + !hci_test_bit(HCI_RAW, &di.flags))
Same here.
> - if (hci_test_bit(HCI_RAW, &di.flags)) {
> + if (!is_bredr_hci_device_type(di.type) ||
> + hci_test_bit(HCI_RAW, &di.flags)) {
And here.
> - if (hci_test_bit(HCI_RAW, &di->flags))
> + if (!is_bredr_hci_device_type(di->type) ||
> + hci_test_bit(HCI_RAW, &di->flags))
And here.
> - if (hci_test_bit(HCI_RAW, &di->flags))
> + if (!is_bredr_hci_device_type(di->type) ||
> + hci_test_bit(HCI_RAW, &di->flags))
And here.
Johan
next prev parent reply other threads:[~2010-08-09 21:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-09 21:07 [PATCH 0/2] Use HCI device type to determine suitability of HCI commands David Scherba
2010-08-09 21:07 ` [PATCH 1/2] Remove non-functional hci_devinfo calls in init_device() David Scherba
2010-08-09 21:51 ` Johan Hedberg
2010-08-10 15:12 ` David Scherba
2010-08-09 21:07 ` [PATCH 2/2] Use HCI device type to gate BR/EDR-specific HCI commands David Scherba
2010-08-09 21:59 ` Johan Hedberg [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-08-10 15:15 [PATCH v2 0/2] Use HCI device type to determine suitability of " David Scherba
2010-08-10 15:15 ` [PATCH 2/2] Use HCI device type to gate BR/EDR-specific " David Scherba
2010-08-10 15:44 ` David Scherba
2010-08-10 15:45 ` David Scherba
2010-08-10 19:16 ` Johan Hedberg
2010-08-10 19:49 ` David Scherba
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=20100809215913.GB25488@jh-x301 \
--to=johan.hedberg@gmail.com \
--cc=dscherba@codeaurora.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=rshaffer@codeaurora.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