public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rename member variable count to disabled in struct tasklet_struct
@ 2001-12-01  3:09 Ryan Bradetich
  0 siblings, 0 replies; only message in thread
From: Ryan Bradetich @ 2001-12-01  3:09 UTC (permalink / raw)
  To: linux-kernel

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;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-12-01  3:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-01  3:09 [PATCH] rename member variable count to disabled in struct tasklet_struct Ryan Bradetich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox