@@ -594,17 +594,17 @@ struct tasklet_struct
struct tasklet_struct *next;
unsigned long state;
atomic_t count;
- void (*func)(unsigned long);
+ void (*func)(struct tasklet_struct *);
};
-#define TASKLET_DATA_TYPE unsigned long
+#define TASKLET_DATA_TYPE struct tasklet_struct *
#define TASKLET_FUNC_TYPE void (*)(TASKLET_DATA_TYPE)
#define DECLARE_TASKLET(name, func) \
-struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), (TASKLET_FUNC_TYPE)func }
+struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func }
#define DECLARE_TASKLET_DISABLED(name, func) \
-struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), (TASKLET_FUNC_TYPE)func }
+struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func }
enum
@@ -673,7 +673,7 @@ static inline void tasklet_enable(struct tasklet_struct *t)
extern void tasklet_kill(struct tasklet_struct *t);
extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu);
extern void tasklet_init(struct tasklet_struct *t,
- void (*func)(unsigned long));
+ void (*func)(struct tasklet_struct *));
#define from_tasklet(var, callback_tasklet, tasklet_fieldname) \
container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
@@ -520,7 +520,7 @@ static void tasklet_action_common(struct softirq_action *a,
if (!test_and_clear_bit(TASKLET_STATE_SCHED,
&t->state))
BUG();
- t->func((TASKLET_DATA_TYPE)t);
+ t->func(t);
tasklet_unlock(t);
continue;
}
@@ -547,7 +547,7 @@ static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
}
void tasklet_init(struct tasklet_struct *t,
- void (*func)(unsigned long))
+ void (*func)(struct tasklet_struct *))
{
t->next = NULL;
t->state = 0;
Now that everything has been converted, we can use the new prototype of the callbacks. This converts the cast macros, the handler field and the tasklet initialization functions to the new prototype. Signed-off-by: Romain Perier <romain.perier@gmail.com> --- include/linux/interrupt.h | 10 +++++----- kernel/softirq.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-)