Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp780588lqm; Wed, 1 May 2024 16:03:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9Dx0PfOodbu87eeyEqvjXjLRS4mSIMs6FnKpm6kK7KfF87243+WMmkfK6ucGpD/4alIHsMK3Wzplc/XOp5GiXUFd/DJnyI3vnJXavgQ== X-Google-Smtp-Source: AGHT+IHLi5vkUB9IHp0SAG02MUfzv0HmCRYBf6C7EQ3P8UDpGEnY+rTxq4W2GHAB+6bM7EB8/ZI8 X-Received: by 2002:a05:6a20:9794:b0:1a7:64dd:ebe8 with SMTP id hx20-20020a056a20979400b001a764ddebe8mr3726627pzc.49.1714604623030; Wed, 01 May 2024 16:03:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714604623; cv=pass; d=google.com; s=arc-20160816; b=mauc1O3oZlzZ0BvIGEY5i0rb8IOreZ5KbWVyCKz4FGJY+u0twYFOKdse5a1kN9KVz7 +Ze/Z4jNWgDXxbe2qxoaE9Yndi6bwhRvVWJ8DJJ3+Yc4i+S4zS22O+Wl3xOLnO0/wAcR E3gwxVhG3d4zgcn2Fgl7BvNBqOD5kZk9nyNRe3ZDg1Bkk31weL+MWSI/uZegXzJtNA6F uHKcV1NeuVTi3iET4jrvX38ZIMVVgGZzJ7orz5TKOXit1c6RgaQHiWahEJDb4SHbO/OX Kl4znZq7mOhCJK60FjOOI7Q+/Kjedl/QMBMhpWHQ8zlX4R84+BW8fXFbanGzfbhYFNDb uxMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=t3KtduwuuW5FhB4DwG9Ko6qfIP+5yj3EcOpSQWfA2ew=; fh=Zlz3/cvqYWy6KB/xg1MK1MpG72Qtzx4fhinCkH5WKpk=; b=rn6iWPrlVcHmte530SJfrKPd2knnjtOq5wXh9ZanUHPpPjFRDOfQUHs0ZHgAZczLmr SP41WJcwFSv6kVCMGtLY52sG2w7zu+RlqNldiM0sFvMvoRK6pFFsbCPILTVfc33Pw4ys BI/b0j9fQGvtv96redudlprr3VW3Uk9nc+cGTth8t8piOkT5+jGDpk1uZoDEytQiZLz5 iaXOmyzkpsKiimK4jJbAWkAsHHTOj6wd96ghr2HzDKBH2+2jjSPQb29KVgn4xlYWh7b0 JoFqRLmdeGOdS40YlVlvHNnLyA7WLefyqjuqw+U8OGGUDWeLP1zPoOJEfrEjXk5xx8oW Qgsg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vJCwT8uw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165800-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j11-20020a63fc0b000000b005f3e5edcbdasi24883294pgi.368.2024.05.01.16.03.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 16:03:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165800-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vJCwT8uw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-165800-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4A739B21ECC for ; Wed, 1 May 2024 23:02:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8790516ABFD; Wed, 1 May 2024 23:01:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vJCwT8uw" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C4F31304A1; Wed, 1 May 2024 23:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714604492; cv=none; b=QCVsMqMYgzZoAy1XLqX423AfXKl0TJ3NGl4HbS7siBsoOez1F7e7UmIIy3Ndezvldp3l0GxNLnGN6TKQDISdiLXgjAdsC9L7hTnqun+eyIr9mNyFqPh25B6mFZMCvdXvFQtAhMKpRHgLJOGYg9r0IipRRjf8wN8fsUIJBor2loc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714604492; c=relaxed/simple; bh=JT6TJe0r0m31NAees1xlMQgr2WRm/aZdIYw3Usfm6aw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=W3pVfZ4nHShvTCj8PCrkxEbYdZcViEuaQWMzu69kVeFTJi1QI9pN7kFw3ZTVkOmzX2hL/GFq7klglSZzJ3cmvDFuiYCVZ3aw3H72K1RpDf8Q+VAuxp9SOqFsAIplG6dZyucEmTaMEMzLnLW6B4RXFw1JkVAPVQi+BfUzmVVZvXI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vJCwT8uw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 259E6C072AA; Wed, 1 May 2024 23:01:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714604492; bh=JT6TJe0r0m31NAees1xlMQgr2WRm/aZdIYw3Usfm6aw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vJCwT8uwqAS1XjmZUiYIgd500wozQllVLdC9W43l4kcQae9gLVbKtFxFBKwXdPGdn 0BcRIa+RY0Pcg4CA0XaiwjTsrx9+4gQlEMq8jR7zEIpL/f/4KTXISZyXfyZNbjJGni D3q82CcGF7LEmHqJFEfvjTaweIDFXQhU7k7TnZtBNnFpGOeA9EcdVfX3KVGXzBYTL7 DMQuAZV67wslIYmRc6fuTAfPlsfInAjnVtOzRzGtXDRJ1fjmDhgs8DFl+KbaNMTegF 51DiPZvNyOuglY4d+1eo5rhMC1sEEjeTwMRstdwz0C0t2c9+yHIbNKlVcXgPe/goB/ rvvDVSt3w1MJg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id BD5CECE1073; Wed, 1 May 2024 16:01:31 -0700 (PDT) From: "Paul E. McKenney" To: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: elver@google.com, akpm@linux-foundation.org, tglx@linutronix.de, peterz@infradead.org, dianders@chromium.org, pmladek@suse.com, arnd@arndb.de, torvalds@linux-foundation.org, kernel-team@meta.com, Al Viro , "Paul E . McKenney" Subject: [PATCH v2 cmpxchg 01/13] sparc32: make __cmpxchg_u32() return u32 Date: Wed, 1 May 2024 16:01:18 -0700 Message-Id: <20240501230130.1111603-1-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Al Viro Conversion between u32 and unsigned long is tautological there, and the only use of return value is to return it from __cmpxchg() (which return unsigned long). Get rid of explicit casts in __cmpxchg_u32() call, while we are at it - normal conversions for arguments will do just fine. Signed-off-by: Al Viro Signed-off-by: Paul E. McKenney --- arch/sparc/include/asm/cmpxchg_32.h | 4 ++-- arch/sparc/lib/atomic32.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/sparc/include/asm/cmpxchg_32.h b/arch/sparc/include/asm/cmpxchg_32.h index d0af82c240b73..2a05cb236480c 100644 --- a/arch/sparc/include/asm/cmpxchg_32.h +++ b/arch/sparc/include/asm/cmpxchg_32.h @@ -39,7 +39,7 @@ static __always_inline unsigned long __arch_xchg(unsigned long x, __volatile__ v /* bug catcher for when unsupported size is used - won't link */ void __cmpxchg_called_with_bad_pointer(void); /* we only need to support cmpxchg of a u32 on sparc */ -unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); +u32 __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); /* don't worry...optimizer will get rid of most of this */ static inline unsigned long @@ -47,7 +47,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) { switch (size) { case 4: - return __cmpxchg_u32((u32 *)ptr, (u32)old, (u32)new_); + return __cmpxchg_u32(ptr, old, new_); default: __cmpxchg_called_with_bad_pointer(); break; diff --git a/arch/sparc/lib/atomic32.c b/arch/sparc/lib/atomic32.c index cf80d1ae352be..d90d756123d81 100644 --- a/arch/sparc/lib/atomic32.c +++ b/arch/sparc/lib/atomic32.c @@ -159,7 +159,7 @@ unsigned long sp32___change_bit(unsigned long *addr, unsigned long mask) } EXPORT_SYMBOL(sp32___change_bit); -unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new) +u32 __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new) { unsigned long flags; u32 prev; @@ -169,7 +169,7 @@ unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new) *ptr = new; spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags); - return (unsigned long)prev; + return prev; } EXPORT_SYMBOL(__cmpxchg_u32); -- 2.40.1