Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1493127 > unrolled thread

[PATCH] jiffies: add time comparison functions for 64 bit jiffies

Started by"Jason A. Donenfeld" <Jason@zx2c4.com>
First post2016-09-29 05:40 +0200
Last post2016-10-01 02:00 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] jiffies: add time comparison functions for 64 bit jiffies "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-09-29 05:40 +0200
    Re: [PATCH] jiffies: add time comparison functions for 64 bit jiffies "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-10-01 02:00 +0200

#1493127 — [PATCH] jiffies: add time comparison functions for 64 bit jiffies

From"Jason A. Donenfeld" <Jason@zx2c4.com>
Date2016-09-29 05:40 +0200
Subject[PATCH] jiffies: add time comparison functions for 64 bit jiffies
Message-ID<smAmt-7a6-5@gated-at.bofh.it>
Though the time_before and time_after family of functions were nicely
extended to support jiffies64, so that the interface would be
consistent, it was forgotten to also extend the before/after jiffies
functions to support jiffies64. This commit brings the interface to
parity between jiffies and jiffies64, which is quite convenient.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 include/linux/jiffies.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 5fdc553..589d14e 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -150,15 +150,19 @@ static inline u64 get_jiffies_64(void)
 
 /* time_is_before_jiffies(a) return true if a is before jiffies */
 #define time_is_before_jiffies(a) time_after(jiffies, a)
+#define time_is_before_jiffies64(a) time_after64(get_jiffies_64(), a)
 
 /* time_is_after_jiffies(a) return true if a is after jiffies */
 #define time_is_after_jiffies(a) time_before(jiffies, a)
+#define time_is_after_jiffies64(a) time_before64(get_jiffies_64(), a)
 
 /* time_is_before_eq_jiffies(a) return true if a is before or equal to jiffies*/
 #define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a)
+#define time_is_before_eq_jiffies64(a) time_after_eq64(get_jiffies_64(), a)
 
 /* time_is_after_eq_jiffies(a) return true if a is after or equal to jiffies*/
 #define time_is_after_eq_jiffies(a) time_before_eq(jiffies, a)
+#define time_is_after_eq_jiffies64(a) time_before_eq64(get_jiffies_64(), a)
 
 /*
  * Have the 32 bit jiffies value wrap 5 minutes after boot
-- 
2.10.0

[toc] | [next] | [standalone]


#1494328

From"Jason A. Donenfeld" <Jason@zx2c4.com>
Date2016-10-01 02:00 +0200
Message-ID<snfSG-or-15@gated-at.bofh.it>
In reply to#1493127
Nudge, poke.

On Thu, Sep 29, 2016 at 5:33 AM, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> Though the time_before and time_after family of functions were nicely
> extended to support jiffies64, so that the interface would be
> consistent, it was forgotten to also extend the before/after jiffies
> functions to support jiffies64. This commit brings the interface to
> parity between jiffies and jiffies64, which is quite convenient.
>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
>  include/linux/jiffies.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
> index 5fdc553..589d14e 100644
> --- a/include/linux/jiffies.h
> +++ b/include/linux/jiffies.h
> @@ -150,15 +150,19 @@ static inline u64 get_jiffies_64(void)
>
>  /* time_is_before_jiffies(a) return true if a is before jiffies */
>  #define time_is_before_jiffies(a) time_after(jiffies, a)
> +#define time_is_before_jiffies64(a) time_after64(get_jiffies_64(), a)
>
>  /* time_is_after_jiffies(a) return true if a is after jiffies */
>  #define time_is_after_jiffies(a) time_before(jiffies, a)
> +#define time_is_after_jiffies64(a) time_before64(get_jiffies_64(), a)
>
>  /* time_is_before_eq_jiffies(a) return true if a is before or equal to jiffies*/
>  #define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a)
> +#define time_is_before_eq_jiffies64(a) time_after_eq64(get_jiffies_64(), a)
>
>  /* time_is_after_eq_jiffies(a) return true if a is after or equal to jiffies*/
>  #define time_is_after_eq_jiffies(a) time_before_eq(jiffies, a)
> +#define time_is_after_eq_jiffies64(a) time_before_eq64(get_jiffies_64(), a)
>
>  /*
>   * Have the 32 bit jiffies value wrap 5 minutes after boot
> --
> 2.10.0
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web