diff options
author | Helge Deller <deller@gmx.de> | 2013-03-02 20:01:05 +0100 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2013-03-02 20:01:05 +0100 |
commit | 8527ed4a7086e7312b8d021ea36d367f7e378c2e (patch) | |
tree | 5c980c6f21806b50f4bf11bb414d4e217135a0a5 /arch/parisc/include/asm/atomic.h | |
parent | parisc: check return value of down_interruptible() in hp_sdc_rtc.c (diff) | |
download | linux-8527ed4a7086e7312b8d021ea36d367f7e378c2e.tar.xz linux-8527ed4a7086e7312b8d021ea36d367f7e378c2e.zip |
parisc: fix compile warnings triggered by atomic_sub(sizeof(),v)
This fixes compile warnings like this one:
net/ipv4/igmp.c: In function ‘ip_mc_leave_group’:
net/ipv4/igmp.c:1898:3: warning: overflow in implicit constant conversion [-Woverflow]
atomic_sub() is defined as __atomic_add_return(-(VAL),(v))))
and if VAL is of type unsigned int (as returned by sizeof()), negating
this value will overflow. Fix this by type-casting VAL to int type.
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/include/asm/atomic.h')
-rw-r--r-- | arch/parisc/include/asm/atomic.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h index af9cf30ed474..f38e1984b242 100644 --- a/arch/parisc/include/asm/atomic.h +++ b/arch/parisc/include/asm/atomic.h @@ -115,8 +115,8 @@ static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u) } -#define atomic_add(i,v) ((void)(__atomic_add_return( (i),(v)))) -#define atomic_sub(i,v) ((void)(__atomic_add_return(-(i),(v)))) +#define atomic_add(i,v) ((void)(__atomic_add_return( (i),(v)))) +#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int) (i)),(v)))) #define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) #define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) |