From patchwork Thu Aug 4 09:43:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josip Rodin X-Patchwork-Id: 108393 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 25B39B6F7B for ; Thu, 4 Aug 2011 19:43:22 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752116Ab1HDJnV (ORCPT ); Thu, 4 Aug 2011 05:43:21 -0400 Received: from orion.CARNet.hr ([161.53.160.90]:45780 "EHLO orion.carnet.hr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751675Ab1HDJnU (ORCPT ); Thu, 4 Aug 2011 05:43:20 -0400 Received: from joy by orion.carnet.hr with local (Exim 4.72) (envelope-from ) id 1QouSR-0000mS-Ig; Thu, 04 Aug 2011 11:43:15 +0200 Date: Thu, 4 Aug 2011 11:43:15 +0200 From: Josip Rodin To: Stephen Rothwell Cc: David Miller , sparclinux@vger.kernel.org, Arun Sharma , Andrew Morton Subject: Re: sparc: rename atomic_add_unless Message-ID: <20110804094315.GA2005@entuzijast.net> References: <20110728104017.GA27861@entuzijast.net> <20110804.012146.856104592127548350.davem@davemloft.net> <20110804193916.7539e625078644f46ed33a72@canb.auug.org.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110804193916.7539e625078644f46ed33a72@canb.auug.org.au> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org On Thu, Aug 04, 2011 at 07:39:16PM +1000, Stephen Rothwell wrote: > Hi Dave, > > On Thu, 04 Aug 2011 01:21:46 -0700 (PDT) David Miller wrote: > > > > From: Josip Rodin > > Date: Thu, 28 Jul 2011 12:40:17 +0200 > > > > > This patch[0] seems to fix a build issue, but it doesn't fix the > > > functionality - the previous change[1] changed the return value semantics, > > > it's now supposed to be to be just the old value, rather than a comparison. > > > > > > [0] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=678624e401b0b7747762b5223fb23f86dcdacc93 > > > [1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f24219b4e90cf70ec4a211b17fbabc725a0ddf3c > > > > Stephen please post a fix for this before a 32-bit sparc person > > loses their filesystem or worse. > > Um, I could try to figure out how to do that, but what I did was respond > in July 29 to the message above cc'ing the author of the orignal patch in > the hope that they would write a fix. Clearly that hope was in vain :-( It should be fairly trivial: diff --git a/arch/sparc/lib/atomic32.c b/arch/sparc/lib/atomic32.c index 8600eb2..1d32b54 100644 --- a/arch/sparc/lib/atomic32.c +++ b/arch/sparc/lib/atomic32.c @@ -65,7 +65,7 @@ int __atomic_add_unless(atomic_t *v, int a, int u) if (ret != u) v->counter += a; spin_unlock_irqrestore(ATOMIC_HASH(v), flags); - return ret != u; + return ret; } EXPORT_SYMBOL(__atomic_add_unless);