]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: cmpxchg: avoid warnings from macro-ized cmpxchg() implementations
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 26 May 2015 14:41:41 +0000 (15:41 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 2 Jun 2015 08:58:20 +0000 (09:58 +0100)
commit76be40389b1090de8d46c6869c4cdd158d490c44
treefdc9b2bd1e7e8e01408a04df122b53130e272985
parent3978f799f16f9fe026cba4af956113490f9be061
ARM: cmpxchg: avoid warnings from macro-ized cmpxchg() implementations

A recent change in kernel/acct.c added a new warning for many
configurations on ARM:

kernel/acct.c: In function 'acct_pin_kill':
arch/arm/include/asm/cmpxchg.h:122:3: warning: value computed is not used [-Wunused-value]

The code is in fact correct, it's just a cmpxchg() call that
intentionally ignores the result, and no other code does that.  The
warning does not show up on x86 because of the way that its cmpxchg()
macro is written. This changes the ARM implementation to use a similar
construct with a compound expression instead of a typecast, which causes
the compiler to not complain about an unused result.

Fix the other macros in this file in a similar way, and place them
just below their function implementations.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/cmpxchg.h