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; }