[PATCH] rename member variable count to disabled in struct

Ryan Bradetich (rbradetich@uswest.net)
30 Nov 2001 20:09:49 -0700


In a previous email:
http://marc.theaimsgroup.com/?l=linux-kernel&m=100710086202226&w=2

I asked about the possibility of renaming the member variable count to
disabled in the struct tasklet_struct. I didn't get any responses to my
question so I thought I'd try asking the question a different way :)

This patch does not make any functional changes to the kernel, but I do
believe it makes the tasklet code more readable.

I have tested this against the 2.4.16 kernel.

Thanks,

- Ryan

--- include/linux/interrupt.h 2001/11/09 23:37:14 1.9
+++ include/linux/interrupt.h 2001/12/01 02:09:32
@@ -104,7 +104,7 @@ struct tasklet_struct
{
struct tasklet_struct *next;
unsigned long state;
- atomic_t count;
+ atomic_t disabled;
void (*func)(unsigned long);
unsigned long data;
};
@@ -171,7 +171,7 @@ static inline void tasklet_hi_schedule(s

static inline void tasklet_disable_nosync(struct tasklet_struct *t)
{
- atomic_inc(&t->count);
+ atomic_inc(&t->disabled);
smp_mb__after_atomic_inc();
}

@@ -185,13 +185,13 @@ static inline void tasklet_disable(struc
static inline void tasklet_enable(struct tasklet_struct *t)
{
smp_mb__before_atomic_dec();
- atomic_dec(&t->count);
+ atomic_dec(&t->disabled);
}

static inline void tasklet_hi_enable(struct tasklet_struct *t)
{
smp_mb__before_atomic_dec();
- atomic_dec(&t->count);
+ atomic_dec(&t->disabled);
}

extern void tasklet_kill(struct tasklet_struct *t);
--- kernel/softirq.c 2001/11/09 23:37:17 1.9
+++ kernel/softirq.c 2001/12/01 02:09:32
@@ -189,7 +189,7 @@ static void tasklet_action(struct softir
list = list->next;

if (tasklet_trylock(t)) {
- if (!atomic_read(&t->count)) {
+ if (!atomic_read(&t->disabled)) {
if
(!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
BUG();
t->func(t->data);
@@ -223,7 +223,7 @@ static void tasklet_hi_action(struct sof
list = list->next;

if (tasklet_trylock(t)) {
- if (!atomic_read(&t->count)) {
+ if (!atomic_read(&t->disabled)) {
if
(!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
BUG();
t->func(t->data);
@@ -247,7 +247,7 @@ void tasklet_init(struct tasklet_struct
{
t->next = NULL;
t->state = 0;
- atomic_set(&t->count, 0);
+ atomic_set(&t->disabled, 0);
t->func = func;
t->data = data;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/