staging: line6: avoid __sync_fetch_and_{and,or}
authorArnd Bergmann <arnd@arndb.de>
Fri, 21 Jun 2013 19:55:35 +0000 (21:55 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Aug 2015 23:32:19 +0000 (00:32 +0100)
commitcee9e1e861382df144a3a880f8e2c89285197a3e
treec3d5326bb40ae77ce345dfcd5d459fb135f6d3f4
parent53774d1d22885f5bf14645baf551a3c4b6a6efba
staging: line6: avoid __sync_fetch_and_{and,or}

commit 9f613601482c56e05884f21565e3d218fac427ae upstream.

__sync_fetch_and_and and __sync_fetch_and_or are functions that are provided
by gcc and depending on the target architecture may be implemented in libgcc,
which is not always available in the kernel. This leads to a build failure
on ARMv5:

drivers/built-in.o: In function `line6_pcm_release':
:(.text+0x3bfe80): undefined reference to `__sync_fetch_and_and_4'
drivers/built-in.o: In function `line6_pcm_acquire':
:(.text+0x3bff30): undefined reference to `__sync_fetch_and_or_4'

To work around this, we can use the kernel-provided cmpxchg macro.

Build-tested only.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Markus Grabner <grabner@icg.tugraz.at>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2:
 - Adjust context
 - Fix up two more instances of __sync_fetch_and_and() that were removed
   separately upstream]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/staging/line6/pcm.c