timer: Remove unused data arguments from macros
With the .data field removed, the ignored data arguments in timer macros can be removed. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tejun Heo <tj@kernel.org> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Cc: Jens Axboe <axboe@kernel.dk> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Shaohua Li <shli@fb.com> Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
parent
354b46b1a0
commit
1fe66ba572
@ -119,7 +119,6 @@ struct kthread_delayed_work {
|
|||||||
#define KTHREAD_DELAYED_WORK_INIT(dwork, fn) { \
|
#define KTHREAD_DELAYED_WORK_INIT(dwork, fn) { \
|
||||||
.work = KTHREAD_WORK_INIT((dwork).work, (fn)), \
|
.work = KTHREAD_WORK_INIT((dwork).work, (fn)), \
|
||||||
.timer = __TIMER_INITIALIZER((TIMER_FUNC_TYPE)kthread_delayed_work_timer_fn,\
|
.timer = __TIMER_INITIALIZER((TIMER_FUNC_TYPE)kthread_delayed_work_timer_fn,\
|
||||||
(TIMER_DATA_TYPE)&(dwork.timer), \
|
|
||||||
TIMER_IRQSAFE), \
|
TIMER_IRQSAFE), \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +166,6 @@ extern void __kthread_init_worker(struct kthread_worker *worker,
|
|||||||
kthread_init_work(&(dwork)->work, (fn)); \
|
kthread_init_work(&(dwork)->work, (fn)); \
|
||||||
__setup_timer(&(dwork)->timer, \
|
__setup_timer(&(dwork)->timer, \
|
||||||
(TIMER_FUNC_TYPE)kthread_delayed_work_timer_fn,\
|
(TIMER_FUNC_TYPE)kthread_delayed_work_timer_fn,\
|
||||||
(TIMER_DATA_TYPE)&(dwork)->timer, \
|
|
||||||
TIMER_IRQSAFE); \
|
TIMER_IRQSAFE); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ struct timer_list {
|
|||||||
#define TIMER_DATA_TYPE struct timer_list *
|
#define TIMER_DATA_TYPE struct timer_list *
|
||||||
#define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE)
|
#define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE)
|
||||||
|
|
||||||
#define __TIMER_INITIALIZER(_function, _data, _flags) { \
|
#define __TIMER_INITIALIZER(_function, _flags) { \
|
||||||
.entry = { .next = TIMER_ENTRY_STATIC }, \
|
.entry = { .next = TIMER_ENTRY_STATIC }, \
|
||||||
.function = (_function), \
|
.function = (_function), \
|
||||||
.flags = (_flags), \
|
.flags = (_flags), \
|
||||||
@ -76,7 +76,7 @@ struct timer_list {
|
|||||||
|
|
||||||
#define DEFINE_TIMER(_name, _function) \
|
#define DEFINE_TIMER(_name, _function) \
|
||||||
struct timer_list _name = \
|
struct timer_list _name = \
|
||||||
__TIMER_INITIALIZER((TIMER_FUNC_TYPE)_function, 0, 0)
|
__TIMER_INITIALIZER((TIMER_FUNC_TYPE)_function, 0)
|
||||||
|
|
||||||
void init_timer_key(struct timer_list *timer, unsigned int flags,
|
void init_timer_key(struct timer_list *timer, unsigned int flags,
|
||||||
const char *name, struct lock_class_key *key);
|
const char *name, struct lock_class_key *key);
|
||||||
@ -115,13 +115,13 @@ static inline void init_timer_on_stack_key(struct timer_list *timer,
|
|||||||
init_timer_on_stack_key((_timer), (_flags), NULL, NULL)
|
init_timer_on_stack_key((_timer), (_flags), NULL, NULL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define __setup_timer(_timer, _fn, _data, _flags) \
|
#define __setup_timer(_timer, _fn, _flags) \
|
||||||
do { \
|
do { \
|
||||||
__init_timer((_timer), (_flags)); \
|
__init_timer((_timer), (_flags)); \
|
||||||
(_timer)->function = (_fn); \
|
(_timer)->function = (_fn); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define __setup_timer_on_stack(_timer, _fn, _data, _flags) \
|
#define __setup_timer_on_stack(_timer, _fn, _flags) \
|
||||||
do { \
|
do { \
|
||||||
__init_timer_on_stack((_timer), (_flags)); \
|
__init_timer_on_stack((_timer), (_flags)); \
|
||||||
(_timer)->function = (_fn); \
|
(_timer)->function = (_fn); \
|
||||||
@ -132,16 +132,14 @@ static inline void timer_setup(struct timer_list *timer,
|
|||||||
void (*callback)(struct timer_list *),
|
void (*callback)(struct timer_list *),
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
__setup_timer(timer, (TIMER_FUNC_TYPE)callback,
|
__setup_timer(timer, (TIMER_FUNC_TYPE)callback, flags);
|
||||||
(TIMER_DATA_TYPE)timer, flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void timer_setup_on_stack(struct timer_list *timer,
|
static inline void timer_setup_on_stack(struct timer_list *timer,
|
||||||
void (*callback)(struct timer_list *),
|
void (*callback)(struct timer_list *),
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
__setup_timer_on_stack(timer, (TIMER_FUNC_TYPE)callback,
|
__setup_timer_on_stack(timer, (TIMER_FUNC_TYPE)callback, flags);
|
||||||
(TIMER_DATA_TYPE)timer, flags);
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
@ -151,11 +149,11 @@ static inline void timer_setup_on_stack(struct timer_list *timer,
|
|||||||
*/
|
*/
|
||||||
# define timer_setup(timer, callback, flags) \
|
# define timer_setup(timer, callback, flags) \
|
||||||
__setup_timer((timer), (TIMER_FUNC_TYPE)(callback), \
|
__setup_timer((timer), (TIMER_FUNC_TYPE)(callback), \
|
||||||
(TIMER_DATA_TYPE)(timer), (flags))
|
(flags))
|
||||||
# define timer_setup_on_stack(timer, callback, flags) \
|
# define timer_setup_on_stack(timer, callback, flags) \
|
||||||
__setup_timer_on_stack((timer), \
|
__setup_timer_on_stack((timer), \
|
||||||
(TIMER_FUNC_TYPE)(callback), \
|
(TIMER_FUNC_TYPE)(callback), \
|
||||||
(TIMER_DATA_TYPE)(timer), (flags))
|
(flags))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define from_timer(var, callback_timer, timer_fieldname) \
|
#define from_timer(var, callback_timer, timer_fieldname) \
|
||||||
|
@ -177,7 +177,6 @@ struct execute_work {
|
|||||||
#define __DELAYED_WORK_INITIALIZER(n, f, tflags) { \
|
#define __DELAYED_WORK_INITIALIZER(n, f, tflags) { \
|
||||||
.work = __WORK_INITIALIZER((n).work, (f)), \
|
.work = __WORK_INITIALIZER((n).work, (f)), \
|
||||||
.timer = __TIMER_INITIALIZER((TIMER_FUNC_TYPE)delayed_work_timer_fn,\
|
.timer = __TIMER_INITIALIZER((TIMER_FUNC_TYPE)delayed_work_timer_fn,\
|
||||||
(TIMER_DATA_TYPE)&(n.timer), \
|
|
||||||
(tflags) | TIMER_IRQSAFE), \
|
(tflags) | TIMER_IRQSAFE), \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +243,6 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
|
|||||||
INIT_WORK(&(_work)->work, (_func)); \
|
INIT_WORK(&(_work)->work, (_func)); \
|
||||||
__setup_timer(&(_work)->timer, \
|
__setup_timer(&(_work)->timer, \
|
||||||
(TIMER_FUNC_TYPE)delayed_work_timer_fn, \
|
(TIMER_FUNC_TYPE)delayed_work_timer_fn, \
|
||||||
(TIMER_DATA_TYPE)&(_work)->timer, \
|
|
||||||
(_tflags) | TIMER_IRQSAFE); \
|
(_tflags) | TIMER_IRQSAFE); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@ -253,7 +251,6 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
|
|||||||
INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
|
INIT_WORK_ONSTACK(&(_work)->work, (_func)); \
|
||||||
__setup_timer_on_stack(&(_work)->timer, \
|
__setup_timer_on_stack(&(_work)->timer, \
|
||||||
(TIMER_FUNC_TYPE)delayed_work_timer_fn,\
|
(TIMER_FUNC_TYPE)delayed_work_timer_fn,\
|
||||||
(TIMER_DATA_TYPE)&(_work)->timer,\
|
|
||||||
(_tflags) | TIMER_IRQSAFE); \
|
(_tflags) | TIMER_IRQSAFE); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user