Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AB8E272E53; Thu, 20 Aug 2026 16:39:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787243958; cv=none; b=QUrR4T45G/0yGfNei7swP/305HuxIYbeODDphD2NCp8uQi2mWddJ5k9AABCgQKuswL1yazhK4g47ajq8HonCou0dK5xdIZ9c7M8xn8aITwBfcLz/bI4Iy3KjpO+y72rzkUWRBr0MdX07PH8GhIUXuAF1dNKQ3uvgK+M05WU90WQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787243958; c=relaxed/simple; bh=NZlHMlY68ENInyi7BRGfINx01AeByBRx7GdOBe1e6Gs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QUuPxoAPw59InC7FWmFyUjS7ULKDIWdpLpB0c15ASOen1qq7WHuEumqQkjEVCs6mF0yO9if29AW6Jvdyk6FP2ZlaP9kZhFNUK6RGGtpYjLxhyIHELSYe9+1MP6gOpJSxK4zBlQIQUjf8cOPIQiBjid3NOsCSC3W2pTcMN89L5xE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=R0wydB7h; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="R0wydB7h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2D6F1F000E9; Thu, 20 Aug 2026 16:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787243957; bh=aT+274KBQU69PN1B1Tg70GZaNAxb41BgheVPCIiBnyo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R0wydB7he+vfrZmh2SDwLdiLo01ibrvuxmAIRjIEaz1xnh2evTTlZvg3bGC8XM5zv I8/4Ko1qLgQLynbV7EE3qNd6I0kBjiLH7qRTvCfFt2lbsOV5r5allNvd59T6RydcEq +DZSzsML0B/x0bbnHBkXtGTmCC6h3yFJSRdzOrtI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Michael Kelley , Easwar Hariharan , Thomas Gleixner , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 5.15 244/272] jiffies: Define secs_to_jiffies() Date: Thu, 20 Aug 2026 16:57:08 +0200 Message-ID: <20260820145238.939757651@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145231.229664293@linuxfoundation.org> References: <20260820145231.229664293@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Easwar Hariharan [ Upstream commit b35108a51cf7bab58d7eace1267d7965978bcdb8 ] secs_to_jiffies() is defined in hci_event.c and cannot be reused by other call sites. Hoist it into the core code to allow conversion of the ~1150 usages of msecs_to_jiffies() that either: - use a multiplier value of 1000 or equivalently MSEC_PER_SEC, or - have timeouts that are denominated in seconds (i.e. end in 000) It's implemented as a macro to allow usage in static initializers. This will also allow conversion of yet more sites that use (sec * HZ) directly, and improve their readability. Suggested-by: Michael Kelley Signed-off-by: Easwar Hariharan Signed-off-by: Thomas Gleixner Reviewed-by: Luiz Augusto von Dentz Link: https://lore.kernel.org/all/20241030-open-coded-timeouts-v3-1-9ba123facf88@linux.microsoft.com Stable-dep-of: c2816d613f38 ("ice: wait for reset completion in ice_resume()") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- include/linux/jiffies.h | 13 +++++++++++++ net/bluetooth/hci_event.c | 2 -- 2 files changed, 13 insertions(+), 2 deletions(-) --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -371,6 +371,19 @@ static __always_inline unsigned long mse } } +/** + * secs_to_jiffies: - convert seconds to jiffies + * @_secs: time in seconds + * + * Conversion is done by simple multiplication with HZ + * + * secs_to_jiffies() is defined as a macro rather than a static inline + * function so it can be used in static initializers. + * + * Return: jiffies value + */ +#define secs_to_jiffies(_secs) ((_secs) * HZ) + extern unsigned long __usecs_to_jiffies(const unsigned int u); #if !(USEC_PER_SEC % HZ) static inline unsigned long _usecs_to_jiffies(const unsigned int u) --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -42,8 +42,6 @@ #define ZERO_KEY "\x00\x00\x00\x00\x00\x00\x00\x00" \ "\x00\x00\x00\x00\x00\x00\x00\x00" -#define secs_to_jiffies(_secs) msecs_to_jiffies((_secs) * 1000) - /* Handle HCI Event packets */ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb,