Commit 60063497 authored by Arun Sharma's avatar Arun Sharma Committed by Linus Torvalds
Browse files

atomic: use <linux/atomic.h>



This allows us to move duplicated code in <asm/atomic.h>
(atomic_inc_not_zero() for now) to <linux/atomic.h>
Signed-off-by: default avatarArun Sharma <asharma@fb.com>
Reviewed-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 148817ba
......@@ -199,7 +199,6 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
return c != (u);
}
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
/**
* atomic64_add_unless - add unless the number is a given value
......
......@@ -2,7 +2,7 @@
#define _ALPHA_LOCAL_H
#include <linux/percpu.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
typedef struct
{
......
......@@ -17,7 +17,7 @@
#include <linux/init.h>
#include <asm/hwrpb.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/irq.h>
#include <asm/irq_regs.h>
#include <asm/pal.h>
......
......@@ -31,7 +31,7 @@
#include <asm/hwrpb.h>
#include <asm/ptrace.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/io.h>
#include <asm/irq.h>
......
......@@ -6,7 +6,7 @@
*/
#include <linux/spinlock.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
asm (".text \n\
.global _atomic_dec_and_lock \n\
......
......@@ -217,7 +217,6 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
c = old;
return c != u;
}
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
#define atomic_inc(v) atomic_add(1, v)
#define atomic_dec(v) atomic_sub(1, v)
......
......@@ -27,7 +27,7 @@
#include <linux/clockchips.h>
#include <linux/completion.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/cacheflush.h>
#include <asm/cpu.h>
#include <asm/cputype.h>
......
......@@ -25,7 +25,7 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/cacheflush.h>
#include <asm/system.h>
#include <asm/unistd.h>
......
......@@ -20,7 +20,7 @@
#include <linux/io.h>
#include <asm/irq.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/mach/time.h>
#include <asm/mach/irq.h>
......
......@@ -34,7 +34,7 @@
#include <linux/mm.h>
#include <linux/pfn.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <mach/dma.h>
/* I don't quite understand why dc4 fails when this is set to 1 and DMA is enabled */
......
......@@ -11,7 +11,7 @@
#ifndef __CNS3XXX_PM_H
#define __CNS3XXX_PM_H
#include <asm/atomic.h>
#include <linux/atomic.h>
void cns3xxx_pwr_clk_en(unsigned int block);
void cns3xxx_pwr_clk_dis(unsigned int block);
......
......@@ -10,7 +10,7 @@
#include <linux/module.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <mach/system.h>
#include <mach/cns3xxx.h>
#include <mach/pm.h>
......
......@@ -44,7 +44,7 @@
#include <linux/io.h>
#include <asm/irq.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/mach/time.h>
#include <asm/mach/irq.h>
......
......@@ -36,7 +36,7 @@
#include <linux/io.h>
#include <mach/hardware.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/irq.h>
#include <mach/regs-clock.h>
......
......@@ -38,7 +38,7 @@
#include <linux/io.h>
#include <mach/hardware.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/irq.h>
#include <mach/regs-clock.h>
......
......@@ -35,7 +35,7 @@
#include <linux/io.h>
#include <mach/hardware.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/irq.h>
#include <mach/regs-clock.h>
......
......@@ -188,7 +188,6 @@ static inline int atomic_sub_if_positive(int i, atomic_t *v)
#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
#define atomic_add_negative(i, v) (atomic_add_return(i, v) < 0)
#define atomic_inc_not_zero(v) atomic_add_unless(v, 1, 0)
#define atomic_dec_if_positive(v) atomic_sub_if_positive(1, v)
#define smp_mb__before_atomic_dec() barrier()
......
......@@ -97,7 +97,6 @@ static inline void atomic_set_mask(int mask, atomic_t *v)
c = old; \
c != (u); \
})
#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
/*
* atomic_inc_and_test - increment and test
......
......@@ -10,7 +10,7 @@
#include <linux/interrupt.h>
#include <mach/dma.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/blackfin.h>
#include <asm/page.h>
#include <asm-generic/dma.h>
......
......@@ -32,7 +32,7 @@
#include <asm/ptrace.h>
#include <asm/irq.h>
#include <asm/bitops.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <asm/traps.h>
#include <asm/bitsperlong.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment