From patchwork Wed Oct 2 13:45:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 279745 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id BE5542C007C for ; Wed, 2 Oct 2013 23:47:01 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E62ED93BCD; Wed, 2 Oct 2013 13:46:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kw3ODC-wy2pe; Wed, 2 Oct 2013 13:46:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 6969C93BCF; Wed, 2 Oct 2013 13:46:59 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id ADF301C2ADC for ; Wed, 2 Oct 2013 13:46:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A915893BCF for ; Wed, 2 Oct 2013 13:46:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XoWzioy7sWyY for ; Wed, 2 Oct 2013 13:46:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tango.tkos.co.il (tango.tkos.co.il [62.219.50.35]) by hemlock.osuosl.org (Postfix) with ESMTPS id DCF5D93BCD for ; Wed, 2 Oct 2013 13:46:55 +0000 (UTC) Received: from tarshish.tkos.co.il (80.179.12.157.static.012.net.il [80.179.12.157]) (authenticated bits=0) by tango.tkos.co.il (8.14.4/8.12.11) with ESMTP id r92DkZJK031938; Wed, 2 Oct 2013 15:46:43 +0200 From: Baruch Siach To: Chris Zankel Subject: [PATCH] xtensa: fix atomic_decrement_if_positive() return value Date: Wed, 2 Oct 2013 16:45:54 +0300 Message-Id: <3dde633646a3e76217744dbd9e151a4e913a2e88.1380721529.git.baruch@tkos.co.il> X-Mailer: git-send-email 1.8.4.rc3 X-Scanned-By: MIMEDefang 2.62 on 62.219.50.35 Cc: uclibc@uclibc.org, linux-xtensa@linux-xtensa.org X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org atomic_decrement_if_positive() returns the old value of &mem, not the (sometimes undefined) value of __tmp. Fixes the uClibc nptl/tst-sem3 test. Signed-off-by: Baruch Siach --- libc/sysdeps/linux/xtensa/bits/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/sysdeps/linux/xtensa/bits/atomic.h b/libc/sysdeps/linux/xtensa/bits/atomic.h index a31841a..b2be547 100644 --- a/libc/sysdeps/linux/xtensa/bits/atomic.h +++ b/libc/sysdeps/linux/xtensa/bits/atomic.h @@ -154,7 +154,7 @@ typedef uintmax_t uatomic_max_t; : "=&a" (__value), "=&a" (__tmp) \ : "a" (mem) \ : "memory" ); \ - __tmp; \ + __value; \ })