All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Jakub Pawlowski <jpawlowski@google.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v8 2/2] Bluetooth: Add restarting to service discovery
Date: Fri, 16 Jan 2015 12:53:42 +0200	[thread overview]
Message-ID: <20150116105342.GB1630@t440s.lan> (raw)
In-Reply-To: <1421240985-28944-2-git-send-email-jpawlowski@google.com>

Hi Jakub,

On Wed, Jan 14, 2015, Jakub Pawlowski wrote:
> +static void restart_le_scan(struct hci_dev *hdev)
> +{
> +	/* If controller is not scanning we are done. */
> +	if (!test_bit(HCI_LE_SCAN, &hdev->dev_flags))
> +		return;

Since this function is only called from mgmt_device_found() can this
condition actually ever be true?

> +
> +	queue_delayed_work(hdev->workqueue, &hdev->le_scan_restart,
> +			   msecs_to_jiffies(DISCOV_LE_RESTART_DELAY));
> +}

What you should probably be checking for however is that scan_end <
jiffies + msecs_to_jiffies(DISCOV_LE_RESTART_DELAY) since then you know
that the scanning will have stopped by the tame the restart work gets
activated. Or am I thinking wrong here?

>  	if (hdev->discovery.rssi != HCI_RSSI_INVALID &&
> -	    (rssi < hdev->discovery.rssi || rssi == HCI_RSSI_INVALID))
> +	    (rssi == HCI_RSSI_INVALID ||
> +	    (rssi < hdev->discovery.rssi && !test_bit(
> +			HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks))))

What I meant by splitting this is that the !test_bit would start on a
new line. That way you wouldn't need to break the line right after (

Johan

  reply	other threads:[~2015-01-16 10:53 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 [this message]
2015-01-16 11:52     ` Jakub Pawlowski
2015-01-16 10:47 ` [PATCH v8 1/2] Bluetooth: Add le_scan_restart Johan Hedberg
2015-01-16 12:11   ` 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=20150116105342.GB1630@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.