From patchwork Wed Feb 19 22:51:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 866883 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 364B325A33B; Wed, 19 Feb 2025 22:51:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740005492; cv=none; b=OQKwo+BEbcfhgAkLeDiG5YgN62Lj00G1KImVvyXMs85S/uwDNUVUGgaRD9NebySv8rn3C+287GWtKFnW2TM5peQc7AhrKtS8BCdPSDoALbkaP2Zfwz/7xOZaPHtdQubGrmyhVGXnEkWBJDsPQkRc4FgD3j5rP+sBgiRxXCI4LsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740005492; c=relaxed/simple; bh=jSLTuiGnjXNGbqSNycQNLaYuo5WV5biDIqUuYkjOoLk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Jh8QK+FFusdfUHPRs90mWRnLPt5k6bS3+cmjEGnhkbMn3DdTWZ5aUVTRKrLWBfsbDO1yZ+9Xs+z6pOgI2UpHheslVbRi5aYcFBJdpeOMN70YWpIikBzIpv1rtQrdcnJE3O7EIkBNBpgdcrbNek52VBrNAo90chliFgw++YA1Pa4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=AcRUDzne; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="AcRUDzne" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id C10222043DED; Wed, 19 Feb 2025 14:51:30 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C10222043DED DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1740005490; bh=DfRuFuSD7f49dIFrnKJPwzeL+ytShRTpfdnnMHINqkU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=AcRUDznef5RRSHYXZGqwJuRtkGKkG3SYE2tTsp2v+evULQySn4r2Et1tQVRbGtcBI Mp6Cizl46JBTmcQ2offIT3JgwhlfR4tM0fZOFUdO5w89ojyMOck/R6uioRSSa4xYZY U7QBACx0oDiEHH8iURkqFG/d4LzGgCTBLAhCF6xY= From: Easwar Hariharan Date: Wed, 19 Feb 2025 22:51:29 +0000 Subject: [PATCH 1/4] Bluetooth: hci_vhci: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250219-bluetooth-converge-secs-to-jiffies-v1-1-6ab896f5fdd4@linux.microsoft.com> References: <20250219-bluetooth-converge-secs-to-jiffies-v1-0-6ab896f5fdd4@linux.microsoft.com> In-Reply-To: <20250219-bluetooth-converge-secs-to-jiffies-v1-0-6ab896f5fdd4@linux.microsoft.com> To: Marcel Holtmann , Luiz Augusto von Dentz , Johan Hedberg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies(E * 1000) +secs_to_jiffies(E) -msecs_to_jiffies(E * MSEC_PER_SEC) +secs_to_jiffies(E) Signed-off-by: Easwar Hariharan --- drivers/bluetooth/hci_vhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c index 7651321d351ccd5a96503bb555b5d9eb2c35b4ff..963741490106ae686b88babff560dc0ad03ec37d 100644 --- a/drivers/bluetooth/hci_vhci.c +++ b/drivers/bluetooth/hci_vhci.c @@ -316,7 +316,7 @@ static inline void force_devcd_timeout(struct hci_dev *hdev, unsigned int timeout) { #ifdef CONFIG_DEV_COREDUMP - hdev->dump.timeout = msecs_to_jiffies(timeout * 1000); + hdev->dump.timeout = secs_to_jiffies(timeout); #endif } @@ -645,7 +645,7 @@ static int vhci_open(struct inode *inode, struct file *file) file->private_data = data; nonseekable_open(inode, file); - schedule_delayed_work(&data->open_timeout, msecs_to_jiffies(1000)); + schedule_delayed_work(&data->open_timeout, secs_to_jiffies(1)); return 0; } From patchwork Wed Feb 19 22:51:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 866882 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5EE4E25B66C; Wed, 19 Feb 2025 22:51:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740005492; cv=none; b=Nl0T4Qy7zWCZoBoNQTCjXA6ucZN2su+o4nsdSkGcWodYn5NL3odhIa34Kot8jjI1n8zCupZO4Vkrg9FlHO5ZQ8CtKIS7OAl7C0fIHJB7KI92VvdrdW5a3fW1LOJ06XB5u5CqrsjZfd8vyM5JFiU4t82+b43bm35PORjzBUlT7pQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740005492; c=relaxed/simple; bh=gqldzETYE4eIO8/SI33h66mI1sao45EOkmCTt5tg4Qc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S2akJbDruHe96d6cfW3NaL8jGBaAwC+8w8EFobkCnKG40Eb//JFHhR04pUbtURzgIkEqr1ZZu9roAAUtSkUiT+ucEA7SJhOuJxgiBcjwWDq57Cn2eSJUZ3yjvmQkjVCz+aDflLAdW/plyJx9taPmUT4n0Ad9O26VPLen+A3PLFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=bGQH4t6n; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="bGQH4t6n" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id DA1E62043DEE; Wed, 19 Feb 2025 14:51:30 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DA1E62043DEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1740005490; bh=qcydmwtspRWmmaxoob7kiYVpr30AJTytieT4IA+PbUk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bGQH4t6nq1nawFw7HolgqjDsdt3hs5UgzxjsimQSto9W8VSoj+cM7j8uedPnp36Pj u8VWOXQCZS30XuLH23X/1ZYjXHPq2Y+VpQNMyBXYAABgXnMLSG+SSo+Wz3meK588yk TcdNkKfmColoYJvGRPhZKmYv+1kuQMRGM1v+Fasw= From: Easwar Hariharan Date: Wed, 19 Feb 2025 22:51:30 +0000 Subject: [PATCH 2/4] Bluetooth: MGMT: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250219-bluetooth-converge-secs-to-jiffies-v1-2-6ab896f5fdd4@linux.microsoft.com> References: <20250219-bluetooth-converge-secs-to-jiffies-v1-0-6ab896f5fdd4@linux.microsoft.com> In-Reply-To: <20250219-bluetooth-converge-secs-to-jiffies-v1-0-6ab896f5fdd4@linux.microsoft.com> To: Marcel Holtmann , Luiz Augusto von Dentz , Johan Hedberg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies(E * 1000) +secs_to_jiffies(E) -msecs_to_jiffies(E * MSEC_PER_SEC) +secs_to_jiffies(E) Signed-off-by: Easwar Hariharan --- net/bluetooth/hci_sync.c | 2 +- net/bluetooth/mgmt.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index dd770ef5ec36840add2fa0549aa1689135a21e4c..a43749aebf76e83f3541deb346015c5e5a620eda 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -1910,7 +1910,7 @@ int hci_schedule_adv_instance_sync(struct hci_dev *hdev, u8 instance, hdev->adv_instance_timeout = timeout; queue_delayed_work(hdev->req_workqueue, &hdev->adv_instance_expire, - msecs_to_jiffies(timeout * 1000)); + secs_to_jiffies(timeout)); } /* If we're just re-scheduling the same instance again then do not diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index e8533167aa88377e6ecd8702277730db0fd21b36..a31b46db50dd546c665e18786c2e1efc1391ee61 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1533,7 +1533,7 @@ static void mgmt_set_discoverable_complete(struct hci_dev *hdev, void *data, if (hci_dev_test_flag(hdev, HCI_DISCOVERABLE) && hdev->discov_timeout > 0) { - int to = msecs_to_jiffies(hdev->discov_timeout * 1000); + int to = secs_to_jiffies(hdev->discov_timeout); queue_delayed_work(hdev->req_workqueue, &hdev->discov_off, to); } @@ -1641,7 +1641,7 @@ static int set_discoverable(struct sock *sk, struct hci_dev *hdev, void *data, hdev->discov_timeout = timeout; if (cp->val && hdev->discov_timeout > 0) { - int to = msecs_to_jiffies(hdev->discov_timeout * 1000); + int to = secs_to_jiffies(hdev->discov_timeout); queue_delayed_work(hdev->req_workqueue, &hdev->discov_off, to); } @@ -2534,7 +2534,7 @@ static int send_hci_cmd_sync(struct hci_dev *hdev, void *data) skb = __hci_cmd_sync_ev(hdev, le16_to_cpu(cp->opcode), le16_to_cpu(cp->params_len), cp->params, cp->event, cp->timeout ? - msecs_to_jiffies(cp->timeout * 1000) : + secs_to_jiffies(cp->timeout) : HCI_CMD_TIMEOUT); if (IS_ERR(skb)) { mgmt_cmd_status(cmd->sk, hdev->id, MGMT_OP_HCI_CMD_SYNC, From patchwork Wed Feb 19 22:51:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 866881 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79B3D25B674; Wed, 19 Feb 2025 22:51:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740005493; cv=none; b=G2+M/vBiB9k6jwOpRmg58qGclq0gqWPs9GTJopargfpfkjEYqk44OsoKKgwQkLUeaWa3NLm/KJUWCofFwO/RACkw29jsMPvw6KA/l8mIGw9wqK6hVUxqemE6/VXPj2/uNo7ybsx7Xe/RnvFYw8ymqR/ts1lDIlz1IO6ec3HT6zQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740005493; c=relaxed/simple; bh=kVIF8THjMUn5VVKQI5GfRlpOup0bprbVYvJKg4Gv5tU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oqFVEDwt3foy/+0Cirt7XEFAymmDF3IEY447gjCJh+eHZBv/ofH1GGUsiqFm19sjxtYOUieQJekMNq2l4XKvTbrgj2Pm0rZDzlz47xuI5/VwEAEthpaTjRzWbtd1/u9avSsFkfLjHR8YCTON5ashd3GB52lr98Lhv4WqbEluOEw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=SF13xRRF; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="SF13xRRF" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id F40002043DEF; Wed, 19 Feb 2025 14:51:30 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com F40002043DEF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1740005491; bh=2DsnK7hNItSeSllFiYAP/M6VSa6q+8lcbw+HDHEsdqY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=SF13xRRFRtH7qnTvrO5A0O3X3Pj6uRAsloPgfZb8ngTSWG29i19O95q7viFi/qPpT p9DhmJKbSRnDt70ZSbf9EChE6OIXU3rQPanGR+S+C8iKHbRmiumgfG/KjF7RbHtv+Z djBAZgbA0vps9Y3zUZnp8SRaHQi17lxLr8ea5BuA= From: Easwar Hariharan Date: Wed, 19 Feb 2025 22:51:31 +0000 Subject: [PATCH 3/4] Bluetooth: SMP: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250219-bluetooth-converge-secs-to-jiffies-v1-3-6ab896f5fdd4@linux.microsoft.com> References: <20250219-bluetooth-converge-secs-to-jiffies-v1-0-6ab896f5fdd4@linux.microsoft.com> In-Reply-To: <20250219-bluetooth-converge-secs-to-jiffies-v1-0-6ab896f5fdd4@linux.microsoft.com> To: Marcel Holtmann , Luiz Augusto von Dentz , Johan Hedberg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies() for readability. Signed-off-by: Easwar Hariharan --- net/bluetooth/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 8b9724fd752a1a713d55630fb19fc7ffc2ac0079..a31c6acf1df2bbdc512d1406663ad06069c1f184 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -55,7 +55,7 @@ /* Keys which are not distributed with Secure Connections */ #define SMP_SC_NO_DIST (SMP_DIST_ENC_KEY | SMP_DIST_LINK_KEY) -#define SMP_TIMEOUT msecs_to_jiffies(30000) +#define SMP_TIMEOUT secs_to_jiffies(30) #define ID_ADDR_TIMEOUT msecs_to_jiffies(200) From patchwork Wed Feb 19 22:51:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 866504 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79AD925B673; Wed, 19 Feb 2025 22:51:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740005492; cv=none; b=XIm2WHy0oklTaiIpDXjWcxZo31ijFJxAmw9F5yCY0fxk1pqzK315DpcetfzDHzz/+Y92y5waE06CT/B2Z9i0bM7S/OMiQa51EAWei8dczWCBJVDO10W+tlPFrYLcca2wOFv6N47RGhtFL0o1xQQ+CFjfTobDJayRziEr1cO59xg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740005492; c=relaxed/simple; bh=PBRXF9armMwgta/H3/VUaDSYrb+lremo3eCzpe0UShA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G/pV9/vjqEJuDSTaryC3FoYbP6aqxDGDW8QQADORPRSC938wSOqHgGjfrIX6/d8HZPFwzoWe8D0C5pATQAIBWJU4ETrrZf4bz/B1+xEt+TGhJU3hqfC64BmqjfqPeQxh6QH2O0X5drDm3DIUke1OUHtPe3gOUEjNcHua6bRNEnM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=Y2DN8i2U; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Y2DN8i2U" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 1A3002043DF1; Wed, 19 Feb 2025 14:51:31 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1A3002043DF1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1740005491; bh=rjHqqoVAzbNhdmiRuBxyTe/4zXmj+hrF7l9thmBLfyY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Y2DN8i2UgkKldcLp26BsQd2v12X64B14cuMRJbdsKXjM3PQX3kOpTVwmct/Ap6DI0 HnGdsLkEIBxW42PXorqUBLNQLfV86qruIWHwrr1NUVrhWQwYHpK3CqA+vKs97PC5OD 8hE5S+KDdg1W+9gWRQyTJ1o3HjM7CJZgR4mZNEuw= From: Easwar Hariharan Date: Wed, 19 Feb 2025 22:51:32 +0000 Subject: [PATCH 4/4] Bluetooth: L2CAP: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250219-bluetooth-converge-secs-to-jiffies-v1-4-6ab896f5fdd4@linux.microsoft.com> References: <20250219-bluetooth-converge-secs-to-jiffies-v1-0-6ab896f5fdd4@linux.microsoft.com> In-Reply-To: <20250219-bluetooth-converge-secs-to-jiffies-v1-0-6ab896f5fdd4@linux.microsoft.com> To: Marcel Holtmann , Luiz Augusto von Dentz , Johan Hedberg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies() for readability. Signed-off-by: Easwar Hariharan --- include/net/bluetooth/l2cap.h | 4 ++-- net/bluetooth/l2cap_core.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 9189354c568f442ccd55efa37d639a613be470ce..0bf8cb17a6e864793f84a4bc8620414a7a396b2f 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h @@ -38,8 +38,8 @@ #define L2CAP_DEFAULT_TX_WINDOW 63 #define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF #define L2CAP_DEFAULT_MAX_TX 3 -#define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ -#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ +#define L2CAP_DEFAULT_RETRANS_TO 2 /* seconds */ +#define L2CAP_DEFAULT_MONITOR_TO 12 /* seconds */ #define L2CAP_DEFAULT_MAX_PDU_SIZE 1492 /* Sized for AMP packet */ #define L2CAP_DEFAULT_ACK_TO 200 #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index fec11e576f310cda115c924245458368a663528a..bc820958cb9230545d99a942a73ba53eaccba14b 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -282,7 +282,7 @@ static void __set_retrans_timer(struct l2cap_chan *chan) if (!delayed_work_pending(&chan->monitor_timer) && chan->retrans_timeout) { l2cap_set_timer(chan, &chan->retrans_timer, - msecs_to_jiffies(chan->retrans_timeout)); + secs_to_jiffies(chan->retrans_timeout)); } } @@ -291,7 +291,7 @@ static void __set_monitor_timer(struct l2cap_chan *chan) __clear_retrans_timer(chan); if (chan->monitor_timeout) { l2cap_set_timer(chan, &chan->monitor_timer, - msecs_to_jiffies(chan->monitor_timeout)); + secs_to_jiffies(chan->monitor_timeout)); } }