]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/time.h
mmc: sdio: fix wl1251 vendor id
[mirror_ubuntu-bionic-kernel.git] / include / linux / time.h
index 4b62a2c0a66129c7615fd60e36852be02a642a14..9f1501f83e42dcedd7ba4fa0e17b0cdcbec104e7 100644 (file)
@@ -96,4 +96,17 @@ static inline bool itimerspec64_valid(const struct itimerspec64 *its)
  */
 #define time_after32(a, b)     ((s32)((u32)(b) - (u32)(a)) < 0)
 #define time_before32(b, a)    time_after32(a, b)
+
+/**
+ * time_between32 - check if a 32-bit timestamp is within a given time range
+ * @t: the time which may be within [l,h]
+ * @l: the lower bound of the range
+ * @h: the higher bound of the range
+ *
+ * time_before32(t, l, h) returns true if @l <= @t <= @h. All operands are
+ * treated as 32-bit integers.
+ *
+ * Equivalent to !(time_before32(@t, @l) || time_after32(@t, @h)).
+ */
+#define time_between32(t, l, h) ((u32)(h) - (u32)(l) >= (u32)(t) - (u32)(l))
 #endif