]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - include/linux/irq_work.h
irq_work: Convert flags to atomic_t
[thirdparty/linux.git] / include / linux / irq_work.h
index b11fcdfd077076e9593e9af3ea64f443d34572a2..02da997ad12cedc723ff42b0027323f30001ec7b 100644 (file)
@@ -22,7 +22,7 @@
 #define IRQ_WORK_CLAIMED       (IRQ_WORK_PENDING | IRQ_WORK_BUSY)
 
 struct irq_work {
-       unsigned long flags;
+       atomic_t flags;
        struct llist_node llnode;
        void (*func)(struct irq_work *);
 };
@@ -30,11 +30,15 @@ struct irq_work {
 static inline
 void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
 {
-       work->flags = 0;
+       atomic_set(&work->flags, 0);
        work->func = func;
 }
 
-#define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { .func = (_f), }
+#define DEFINE_IRQ_WORK(name, _f) struct irq_work name = {     \
+               .flags = ATOMIC_INIT(0),                        \
+               .func  = (_f)                                   \
+}
+
 
 bool irq_work_queue(struct irq_work *work);
 bool irq_work_queue_on(struct irq_work *work, int cpu);