From: Johan Hedberg <johan.hedberg@gmail.com>
To: Jakub Pawlowski <jpawlowski@google.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v8 1/2] Bluetooth: Add le_scan_restart
Date: Fri, 16 Jan 2015 12:47:45 +0200 [thread overview]
Message-ID: <20150116104745.GA1630@t440s.lan> (raw)
In-Reply-To: <1421240985-28944-1-git-send-email-jpawlowski@google.com>
Hi Jakub,
On Wed, Jan 14, 2015, Jakub Pawlowski wrote:
> +static void le_scan_restart_work_complete(struct hci_dev *hdev, u8 status,
> + u16 opcode)
> +{
> + BT_DBG("%s", hdev->name);
> + if (status) {
> + BT_ERR("Failed to restart LE scan: status %d", status);
> + } else if (test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks) &&
> + hdev->discovery.scan_end != 0) {
> + long timeout = hdev->discovery.scan_end - jiffies;
To make this consistent with the coding style, could you please format
it as:
if (status) {
BT_ERR(...);
return;
}
if (!test_bit(DUP_FILT) || !hdev->discovery_scan_end)
return;
timeout = ...;
> +static void le_scan_restart_work(struct work_struct *work)
> +{
> + struct hci_dev *hdev = container_of(work, struct hci_dev,
> + le_scan_restart.work);
> + struct hci_request req;
> + struct hci_cp_le_set_scan_enable cp;
> + int err;
> +
> + BT_DBG("%s", hdev->name);
> +
> + /* If controller is not scanning we are done. */
> + if (!test_bit(HCI_LE_SCAN, &hdev->dev_flags))
> + return;
Shouldn't you also make sure to cancel this delayed work wherever the
code clears the HCI_LE_SCAN flag? (i.e. in hci_event.c)
Johan
next prev parent reply other threads:[~2015-01-16 10:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-14 13:09 [PATCH v8 1/2] Bluetooth: Add le_scan_restart Jakub Pawlowski
2015-01-14 13:09 ` [PATCH v8 2/2] Bluetooth: Add restarting to service discovery Jakub Pawlowski
2015-01-16 10:53 ` Johan Hedberg
2015-01-16 11:52 ` Jakub Pawlowski
2015-01-16 10:47 ` Johan Hedberg [this message]
2015-01-16 12:11 ` [PATCH v8 1/2] Bluetooth: Add le_scan_restart Jakub Pawlowski
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=20150116104745.GA1630@t440s.lan \
--to=johan.hedberg@gmail.com \
--cc=jpawlowski@google.com \
--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).