summaryrefslogtreecommitdiff
path: root/include/linux/timer.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-05-17 01:38:57 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2018-05-17 02:36:19 -0400
commitff86d4722124c300c40b85b6eb8ef2d410ab303c (patch)
tree05e54b0bf6397ecbb5e7717a7925ac6ed2645a68 /include/linux/timer.h
parent800408be11898f6d53ceecfd894cce8860fda26a (diff)
Update bcachefs sources to 0906b1fb49 bcachefs: fixes for 32 bit/big endian machines
Diffstat (limited to 'include/linux/timer.h')
-rw-r--r--include/linux/timer.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 363f26a4..9667acf9 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -6,27 +6,22 @@
struct timer_list {
unsigned long expires;
- void (*function)(unsigned long);
- unsigned long data;
+ void (*function)(struct timer_list *timer);
bool pending;
};
-static inline void init_timer(struct timer_list *timer)
+static inline void timer_setup(struct timer_list *timer,
+ void (*func)(struct timer_list *),
+ unsigned int flags)
{
memset(timer, 0, sizeof(*timer));
+ timer->function = func;
}
-#define __init_timer(_timer, _flags) init_timer(_timer)
+#define timer_setup_on_stack(timer, callback, flags) \
+ timer_setup(timer, callback, flags)
-#define __setup_timer(_timer, _fn, _data, _flags) \
- do { \
- __init_timer((_timer), (_flags)); \
- (_timer)->function = (_fn); \
- (_timer)->data = (_data); \
- } while (0)
-
-#define setup_timer(timer, fn, data) \
- __setup_timer((timer), (fn), (data), 0)
+#define destroy_timer_on_stack(timer) do {} while (0)
static inline int timer_pending(const struct timer_list *timer)
{
@@ -36,8 +31,9 @@ static inline int timer_pending(const struct timer_list *timer)
int del_timer(struct timer_list * timer);
int del_timer_sync(struct timer_list *timer);
+#define del_singleshot_timer_sync(timer) del_timer_sync(timer)
+
int mod_timer(struct timer_list *timer, unsigned long expires);
-//extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
static inline void add_timer(struct timer_list *timer)
{