public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>,
	Kiran K <kiran.k@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Vijay Satija <vijay.satija@intel.com>,
	Sai Teja Aluvala <aluvala.sai.teja@intel.com>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Bluetooth: btintel_pcie: avoid unguarded 64-bit division
Date: Fri, 25 Jul 2025 11:06:47 +0200	[thread overview]
Message-ID: <20250725090651.2495984-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

Directly dividing a 64-bit value is not allowed on 32-bit
architectures in the kernel.

arm-linux-gnueabi/bin/arm-linux-gnueabi-ld: drivers/bluetooth/btintel_pcie.o: in function `btintel_pcie_suspend_late':
btintel_pcie.c:(.text+0x224): undefined reference to `__aeabi_ldivmod'

Since this is a ktime_t value and dividing by 1000 gives a microsecond
number, just convert it into microseconds using the appropriate helper.

Fixes: 33bb9b1ce6f6 ("Bluetooth: btintel_pcie: Add support for _suspend() / _resume()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/bluetooth/btintel_pcie.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index 9792a49886ff..4dfd5365bb4e 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -2607,7 +2607,7 @@ static int btintel_pcie_suspend_late(struct device *dev, pm_message_t mesg)
 	btintel_pcie_wr_sleep_cntrl(data, dxstate);
 	err = wait_event_timeout(data->gp0_wait_q, data->gp0_received,
 				 msecs_to_jiffies(BTINTEL_DEFAULT_INTR_TIMEOUT_MS));
-	delta = ktime_to_ns(ktime_get() - start) / 1000;
+	delta = ktime_to_us(ktime_get() - start);
 
 	if (err == 0) {
 		bt_dev_err(data->hdev, "Timeout (%u ms) on alive interrupt for D3 entry",
@@ -2651,7 +2651,7 @@ static int btintel_pcie_resume(struct device *dev)
 	btintel_pcie_wr_sleep_cntrl(data, BTINTEL_PCIE_STATE_D0);
 	err = wait_event_timeout(data->gp0_wait_q, data->gp0_received,
 				 msecs_to_jiffies(BTINTEL_DEFAULT_INTR_TIMEOUT_MS));
-	delta = ktime_to_ns(ktime_get() - start) / 1000;
+	delta = ktime_to_us(ktime_get() - start);
 
 	if (err == 0) {
 		bt_dev_err(data->hdev, "Timeout (%u ms) on alive interrupt for D0 entry",
-- 
2.39.5


             reply	other threads:[~2025-07-25  9:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-25  9:06 Arnd Bergmann [this message]
2025-07-25  9:39 ` Bluetooth: btintel_pcie: avoid unguarded 64-bit division bluez.test.bot
2025-07-26 16:00 ` [PATCH] " K, Kiran

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=20250725090651.2495984-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=aluvala.sai.teja@intel.com \
    --cc=arnd@arndb.de \
    --cc=chandrashekar.devegowda@intel.com \
    --cc=kiran.k@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=vijay.satija@intel.com \
    /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