Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1509298lqe; Mon, 8 Apr 2024 10:50:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXbIQeLOxTEjuQQHd2ycithmIWmNDsQIyFZnmoqkYmm0sCc4+7Mcwi9S2e5+2oB/D4btgkSoMas2B43LMnEQ2CjSyqRGzLJLO4sTpuTQ== X-Google-Smtp-Source: AGHT+IHoy8niEZuSpOq5WPuKzxZEIaS2HNpwE3J7vx6dOQi6Zg1RJAhzGPJJLp3/NNUvCPQy40nk X-Received: by 2002:a0c:f9d0:0:b0:69b:145c:9c26 with SMTP id j16-20020a0cf9d0000000b0069b145c9c26mr746146qvo.9.1712598629953; Mon, 08 Apr 2024 10:50:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712598629; cv=pass; d=google.com; s=arc-20160816; b=zSQYbpGD9PH/eGWXFHo2A/LXHQqreJ9h8HhDsRAPyFo477JQEa77A7OboHdpLGRHQm eoRRD1iusfgGMbTUxt1Zjr5ltjfWxSAYoi1u4WX/1HfUoAjMgw95PK3MT88E+5UaYhlE 5f3U7gMYj/Lz9d2IdUH8ebLI8xuYzfdS78vhE7gWZnVqanIw+Fs6sPPWsr4QlMTTiRm/ LW23NYRwcTMNvyHFQjsdDRzPVgFyfS0mnBQ0bwD/U/kPESGlQYXwhIJZj9R7rkfCrI4M HQaLX2YMH+dOpgxUrG5/dzlzt+EPJyEujPOKEspFXaVgAKRLNB+DFG7dxDotJr7NLhfc 5AhQ== 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=PzExHyzS5QoRWEB7baYFYTXldfzInnKPeHTgThnpi/8=; fh=w9S2XPug8Iuwyxj1huAxJ8xgXHl/EkJ/564y4G32wHQ=; b=wHeOxBV3iIgffn0QSZuYeO7U1Ac6vqxNe/pnFs27lkYD3WeKwsROs4X2qk/rx5grpf eRC3gsKBH3UIYY7Un5wMU6TFCzgaSpaTRukeiVgO1ntGymb03Ny/mmAeM/YY1CY9HRra qcFOnU1H1Ajjq5ctzBX8OgpbuVxmQW8WQSf+XeWwI/DuY/LOxd9VYaKCHnWiMHgBjdme sfHHFHtSI1Om1TMIy9+hG7wRWCWSApXbPgs2BEobi5iXlV3KFFC+DdINzLjUk0nCr0ha 9gtK4YLmTwypeflF7xA7QDJ+VDLkD6+yAOSCPi2Ij1EHntCNrXP9EwIJrKNwYZfSyjGQ nIXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cHynODyi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-135774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135774-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i5-20020ad44105000000b0069b241b436bsi956762qvp.236.2024.04.08.10.50.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 10:50:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cHynODyi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-135774-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135774-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AA2031C23944 for ; Mon, 8 Apr 2024 17:50:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1916A145B2A; Mon, 8 Apr 2024 17:49:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cHynODyi" 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 25E641442F5; Mon, 8 Apr 2024 17:49:46 +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=1712598587; cv=none; b=HF5drZ3LJqAYVDJlbtdcu/E7pkkW74PB9aXeCdaTllOMyVlsVxmEtMISVWOfmIhdfv6w0bDzJN34ezNbosbLC+GrqXLGrXZ8Rkcc06uTs/Hm79kOd67glo3mxhrbKfjt2w9zn4O5kJ0B576FIHzZucWeB3xTREdJjPAoq7UsprU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712598587; c=relaxed/simple; bh=xV0bjRNG69Gk9MLDp+p1hE+J2KXV1jWcp0coMhIa834=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vGJYckoS3MzrB+A6G7nUWaj+F02NeTPEpesL4YRCRjJKz3yLehkyEAxEidc6U7LULz34gr+GXlinxiQwnMHdSgdr44uPvOdsQ0EshkX9ddwIoAPel1vw7LEILX/lSHYga3wXh0p5cI5N9tb5qF2V7hoBZIRbwYhgQFpHk0oTTSo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cHynODyi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4D26C433A6; Mon, 8 Apr 2024 17:49:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712598586; bh=xV0bjRNG69Gk9MLDp+p1hE+J2KXV1jWcp0coMhIa834=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cHynODyi86K0iz6CitTyqMyJyLOUHClUFN4tYtRr9OORmhm3UsY+YIyJhBBojQ0w2 gHlHLTEFJ+aLETIDK5/ZWSxCeNhsqrEgGzWWLuwCwyCY0z91Q+AcJCzX1uqgTlz17b TRJnmS7XFmG5VZ6Eqclaqp5K2Msz3Duo3VRKIerFZ1CKenuBFnRqj9myEZUnb7d/Gh 9swwosCwgOr10TiWF1OD8sA3gft4cGvt/cD+ebznXVAhlnZn5RlOsOf9G5AKlJXk0p VB7X4oUln+myzA2zq8L55NOv9c1txNGYMT0vt0rVHYbRvrmg/BQTkepZNoNJ4FJlQP CL3rAirCHB4GA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 4725ECE1E8D; Mon, 8 Apr 2024 10:49:46 -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, torvalds@linux-foundation.org, Arnd Bergmann , Al Viro , "Paul E . McKenney" Subject: [PATCH cmpxchg 05/14] parisc: __cmpxchg_u32(): lift conversion into the callers Date: Mon, 8 Apr 2024 10:49:35 -0700 Message-Id: <20240408174944.907695-5-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <7b3646e0-667c-48e2-8f09-e493c43c30cb@paulmck-laptop> References: <7b3646e0-667c-48e2-8f09-e493c43c30cb@paulmck-laptop> 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 __cmpxchg_u32() return value is unsigned int explicitly cast to unsigned long. Both callers are returns from functions that return unsigned long; might as well have __cmpxchg_u32() return that unsigned int (aka u32) and let the callers convert implicitly. Signed-off-by: Al Viro Signed-off-by: Paul E. McKenney --- arch/parisc/include/asm/cmpxchg.h | 3 +-- arch/parisc/lib/bitops.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/parisc/include/asm/cmpxchg.h b/arch/parisc/include/asm/cmpxchg.h index c1d776bb16b4e..0924ebc576d28 100644 --- a/arch/parisc/include/asm/cmpxchg.h +++ b/arch/parisc/include/asm/cmpxchg.h @@ -57,8 +57,7 @@ __arch_xchg(unsigned long x, volatile void *ptr, int size) extern void __cmpxchg_called_with_bad_pointer(void); /* __cmpxchg_u32/u64 defined in arch/parisc/lib/bitops.c */ -extern unsigned long __cmpxchg_u32(volatile unsigned int *m, unsigned int old, - unsigned int new_); +extern u32 __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_); extern u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new_); extern u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new_); diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c index 36a3141990746..ae2231d921985 100644 --- a/arch/parisc/lib/bitops.c +++ b/arch/parisc/lib/bitops.c @@ -68,16 +68,16 @@ u64 notrace __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new) return prev; } -unsigned long notrace __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsigned int new) +u32 notrace __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new) { unsigned long flags; - unsigned int prev; + u32 prev; _atomic_spin_lock_irqsave(ptr, flags); if ((prev = *ptr) == old) *ptr = new; _atomic_spin_unlock_irqrestore(ptr, flags); - return (unsigned long)prev; + return prev; } u8 notrace __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new) -- 2.40.1