Skip to content

Commit 1f2e4a4

Browse files
committed
Merge: CNB97: jiffies: Define secs_to_jiffies
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6864 JIRA: https://issues.redhat.com/browse/RHEL-91108 * b35108a jiffies: Define secs_to_jiffies() * bb2784d jiffies: Cast to unsigned long in secs_to_jiffies() conversion Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> Approved-by: Jaroslav Kysela <jkysela@redhat.com> Approved-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents b8a154b + 2ece662 commit 1f2e4a4

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

include/linux/jiffies.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,19 @@ static __always_inline unsigned long msecs_to_jiffies(const unsigned int m)
371371
}
372372
}
373373

374+
/**
375+
* secs_to_jiffies: - convert seconds to jiffies
376+
* @_secs: time in seconds
377+
*
378+
* Conversion is done by simple multiplication with HZ
379+
*
380+
* secs_to_jiffies() is defined as a macro rather than a static inline
381+
* function so it can be used in static initializers.
382+
*
383+
* Return: jiffies value
384+
*/
385+
#define secs_to_jiffies(_secs) (unsigned long)((_secs) * HZ)
386+
374387
extern unsigned long __usecs_to_jiffies(const unsigned int u);
375388
#if !(USEC_PER_SEC % HZ)
376389
static inline unsigned long _usecs_to_jiffies(const unsigned int u)

net/bluetooth/hci_event.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
#define ZERO_KEY "\x00\x00\x00\x00\x00\x00\x00\x00" \
4343
"\x00\x00\x00\x00\x00\x00\x00\x00"
4444

45-
#define secs_to_jiffies(_secs) msecs_to_jiffies((_secs) * 1000)
46-
4745
/* Handle HCI Event packets */
4846

4947
static void *hci_ev_skb_pull(struct hci_dev *hdev, struct sk_buff *skb,

0 commit comments

Comments
 (0)