projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a53b42c
)
jiffies: add utility function to calculate delta in ms
author
Matteo Croce
<
[email protected]
>
Tue, 31 Jul 2018 16:03:32 +0000
(18:03 +0200)
committer
Pablo Neira Ayuso
<
[email protected]
>
Thu, 16 Aug 2018 17:36:55 +0000
(19:36 +0200)
add jiffies_delta_to_msecs() helper func to calculate the delta between
two times and eventually 0 if negative.
Suggested-by: Eric Dumazet <
[email protected]
>
Signed-off-by: Matteo Croce <
[email protected]
>
Reviewed-by: Eric Dumazet <
[email protected]
>
Acked-by: Simon Horman <
[email protected]
>
Signed-off-by: Pablo Neira Ayuso <
[email protected]
>
include/linux/jiffies.h
patch
|
blob
|
history
diff --git
a/include/linux/jiffies.h
b/include/linux/jiffies.h
index a27cf66523279c1a5d4aaa0d0087f1e9d48d170f..fa928242567db30769839ac8738be5dc58e372ab 100644
(file)
--- a/
include/linux/jiffies.h
+++ b/
include/linux/jiffies.h
@@
-447,6
+447,11
@@
static inline clock_t jiffies_delta_to_clock_t(long delta)
return jiffies_to_clock_t(max(0L, delta));
}
+static inline unsigned int jiffies_delta_to_msecs(long delta)
+{
+ return jiffies_to_msecs(max(0L, delta));
+}
+
extern unsigned long clock_t_to_jiffies(unsigned long x);
extern u64 jiffies_64_to_clock_t(u64 x);
extern u64 nsec_to_clock_t(u64 x);