Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05cfb614 authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds
Browse files

[PATCH] hrtimers: remove data field



The nanosleep cleanup allows to remove the data field of hrtimer.  The
callback function can use container_of() to get it's own data.  Since the
hrtimer structure is anyway embedded in other structures, this adds no
overhead.

Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent df869b63
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -632,7 +632,7 @@ static int de_thread(struct task_struct *tsk)
		 * synchronize with any firing (by calling del_timer_sync)
		 * before we can safely let the old group leader die.
		 */
		sig->real_timer.data = current;
		sig->tsk = current;
		spin_unlock_irq(lock);
		if (hrtimer_cancel(&sig->real_timer))
			hrtimer_restart(&sig->real_timer);
+1 −4
Original line number Diff line number Diff line
@@ -45,9 +45,7 @@ struct hrtimer_base;
 * @expires:	the absolute expiry time in the hrtimers internal
 *		representation. The time is related to the clock on
 *		which the timer is based.
 * @state:	state of the timer
 * @function:	timer expiry callback function
 * @data:	argument for the callback function
 * @base:	pointer to the timer base (per cpu and per clock)
 *
 * The hrtimer structure must be initialized by init_hrtimer_#CLOCKTYPE()
@@ -55,8 +53,7 @@ struct hrtimer_base;
struct hrtimer {
	struct rb_node		node;
	ktime_t			expires;
	int			(*function)(void *);
	void			*data;
	int			(*function)(struct hrtimer *);
	struct hrtimer_base	*base;
};

+1 −0
Original line number Diff line number Diff line
@@ -402,6 +402,7 @@ struct signal_struct {

	/* ITIMER_REAL timer for the process */
	struct hrtimer real_timer;
	struct task_struct *tsk;
	ktime_t it_real_incr;

	/* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */
+2 −1
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ static inline void add_timer(struct timer_list *timer)

extern void init_timers(void);
extern void run_local_timers(void);
extern int it_real_fn(void *);
struct hrtimer;
extern int it_real_fn(struct hrtimer *);

#endif
+1 −1
Original line number Diff line number Diff line
@@ -848,7 +848,7 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts
	hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_REL);
	sig->it_real_incr.tv64 = 0;
	sig->real_timer.function = it_real_fn;
	sig->real_timer.data = tsk;
	sig->tsk = tsk;

	sig->it_virt_expires = cputime_zero;
	sig->it_virt_incr = cputime_zero;
Loading