Bluetooth: Update MGMT and SMP timeout constants to use msecs_to_jiffies
The MGMT and SMP timeout constants are always used in form of jiffies. So just include the conversion from msecs in the define itself. This has the advantage of making the code where the timeout is used more readable. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
committed by
Johan Hedberg
parent
ba13ccd9b9
commit
17b02e6256
@@ -116,7 +116,7 @@ static const u16 mgmt_events[] = {
|
||||
#define INQUIRY_LEN_BREDR 0x08 /* TGAP(100) */
|
||||
#define INQUIRY_LEN_BREDR_LE 0x04 /* TGAP(100)/2 */
|
||||
|
||||
#define SERVICE_CACHE_TIMEOUT (5 * 1000)
|
||||
#define CACHE_TIMEOUT msecs_to_jiffies(2 * 1000)
|
||||
|
||||
#define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \
|
||||
!test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
|
||||
@@ -1298,8 +1298,7 @@ static bool enable_service_cache(struct hci_dev *hdev)
|
||||
return false;
|
||||
|
||||
if (!test_and_set_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) {
|
||||
schedule_delayed_work(&hdev->service_cache,
|
||||
msecs_to_jiffies(SERVICE_CACHE_TIMEOUT));
|
||||
schedule_delayed_work(&hdev->service_cache, CACHE_TIMEOUT);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user