Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1841726lqz; Mon, 1 Apr 2024 21:28:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXmceNZFuHFvvRZUAJvM3p9bkEhoZlPi32YwYq2LVv/u7COUQihpEx0G97mhDw5IaLYYZ+C/6Ay6v7S71f1dyvkc4OvHF/MJ5Vcru3Jsw== X-Google-Smtp-Source: AGHT+IH2O3PkcJpAEBpYqsRE7egvhESBrqVZuv9olXHLfD3kOkYj8F9h+fxQjjPF35rCd+uRYEbC X-Received: by 2002:a17:90a:420a:b0:2a2:3223:1930 with SMTP id o10-20020a17090a420a00b002a232231930mr5099290pjg.8.1712032099363; Mon, 01 Apr 2024 21:28:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712032099; cv=pass; d=google.com; s=arc-20160816; b=PlwCo4t+bFUBepXCB9nMFcb6t6Hp++bNXVbnWaMsKVMhFW/0yCCK3t3X3n+j7FMQPW coQlXqyqJkT2Dkbu6e2vLJ3TDm4Pka6RH0oV572CiPASOyUOTeHvo7lNB7mMkk/O60AK 3BDnRUXR+64+c97HrL03ZSy0uViD1qKQDp1HYKIFdHN5wm+edoKmfsHeoQOq9JZ49LiG GtuY/Ti+ePwCcxui8bpiOpaBLOADqmznxeiz8k3esIQqKC5W62PK6OL8102EJ4eSny1n WWTa2lG/U9PYKChkXQUQmkiGxRZbXFbHuHbvl+HPIql0U0kVRNUp+N20zdXSBEeyeLvM 5RoA== 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; bh=RVoFMeDYR7okI0G8rMLKJQWy+X1c2OHRTmcJ/Xu3cmw=; fh=5XKO4FJFa744F7hHLL6pG6MPZgtIgKlwP2n1WruVqgQ=; b=Z6EBIG7z6YA8LYeicMnLlxubX9xAZ9UYP91A9Cj5WRVI/w23q0GxVcEqkty1MA9nLu 3kLw3OXFNh0UK/FHDNLEC19N00iEK20lmAocWm0xWVVCaIzwW6Vtajdh+SWIhR74S9I1 zWtf1dz8Phi25SVGsDxktu962IBwiC1xGoK+BY9C1loaHH/R4X/AdlL9z/dNHyzrJL+W iZ0MoHdFvZ9zHzNE8X7m7AcV3aNZ1UUUQE1T5fs2Xhhvwza/Hifepr5xZNUqHqfMF0Py 5Q/BCFZ3Se8hKFF8IRlDyD61P5lgSWthoagKjMUpbwyCJgi5AEmMPI39QC2r/txtchIU huMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-127376-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127376-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x15-20020a17090a8a8f00b002a2352f8be4si4086279pjn.3.2024.04.01.21.28.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 21:28:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127376-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-127376-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127376-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk 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 6F852B214C2 for ; Tue, 2 Apr 2024 04:27:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DE58200AE; Tue, 2 Apr 2024 04:27:14 +0000 (UTC) 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 98AA71C292 for ; Tue, 2 Apr 2024 04:27:13 +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=1712032033; cv=none; b=Qy8yVpQDzNl9tJWbBQ9O7l2rJXNqBcJ6BRlnHgfAyL2ANrjH6PpaylET1siI0F07Amvg1nivnSGb+qSrd8iFoz/sluJPF/PGGX1aQQ4WiH5l3/J0GDk8zWmmi6D+ZKES75LobS/bbXKigLcca9tkImMm8LtuIYgOPrq7XDuk7WU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712032033; c=relaxed/simple; bh=RihDwvO58suRgQreoRv3uBrOoU2Kph2MBTIP+ZUHIpg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aZlS2FDIfa0AtTtx3JHfczxmNzVgrBUD40RgKdRt8yudkkF7Q9SSb220UybwQ1rAfeyKVo4it//EESV1RQ2W2k/e4/5IBQQ9K0DfvTAz2byAeqg8tzwkH9gOzhnPNaBKSRSV2kQ84LLiDAYzbJBsblLzZwSjdrHzrOM2YCDg5hk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98CC1C43394; Tue, 2 Apr 2024 04:27:12 +0000 (UTC) From: Al Viro To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, "David S. Miller" , Andreas Larsson , Palmer Dabbelt , Arnd Bergmann , Marco Elver Subject: [PATCH 5/8] parisc: __cmpxchg_u32(): lift conversion into the callers Date: Tue, 2 Apr 2024 00:28:32 -0400 Message-Id: <20240402042835.11815-5-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240402042835.11815-1-viro@zeniv.linux.org.uk> References: <20240402041138.GF538574@ZenIV> <20240402042835.11815-1-viro@zeniv.linux.org.uk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit __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 return have __cmpxchg_u32() return that unsigned int (aka u32) and let the callers convert implicitly. Signed-off-by: Al Viro --- 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 c1d776bb16b4..0924ebc576d2 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 36a314199074..ae2231d92198 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.39.2