Skip to contentSkip to conversation

rename member variable count to disabled in struct tasklet_struct

PATCH New Ryan Bradetich 1 participant 1 message Dec 1, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rename member variable count to disabled in struct tasklet_struct

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

linux/interrupt.h 2001/12/01 02:09:32 renamed from linux/interrupt.h 2001/11/09 23:37:14 1.9 +4 -4
@@ -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);
softirq.c 2001/12/01 02:09:32 renamed from softirq.c 2001/11/09 23:37:17 1.9 +1 -1
@@ -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;

}