Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp954487pxj; Wed, 2 Jun 2021 16:16:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZB5BCFKbGYU3gvjAiuvdHHclxjbCF44UT95pyTrETe37udxtnGBMy3/LolJfXbBwZFs7l X-Received: by 2002:a17:906:368e:: with SMTP id a14mr35636387ejc.366.1622675782167; Wed, 02 Jun 2021 16:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622675782; cv=none; d=google.com; s=arc-20160816; b=zyNe88ttEAwajsUF2uRlZrsTPpCq0O8/du8wFX0SloI1j4ucU7lEPOz8Ww1zUcLtvo 5gW/Nra1BGKWz7ccPnZvKEHgTC78ujd9IHzSs8Bad3tDvHdzlHV/cIhr4we/In1VEOl4 u5hW17/qTvceibeVJ8b8qesTEXRGTs6SicDqSCBqrJ9M5l3saweuCNvfGNGYpRbgthEB UcddplAGeRfRDQxiHauMJKNOM8ly9UvJzPFMwQVvLya4SW0/VrcrUFdLXV7maSrsA8jh 7AZSzh0FBS0qHn5qXFMbFSBeBzjziQIOYGLCBNNhlll0NRtuFe55K4GyXmaiUJnDy54z bdOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+Z2iQYoHcJ27W7xRyN7L68l/ztKMEA8mYKYCaCL+K58=; b=GhEtBLShBw4UIRA0xSI15Pu/bogfvv66hHWKXw5rqmOjehZS0MO1CMOmEIo0l+fYiY 7pzgIns4vyXA+iPY+ydaI/SkLMHLk9qlFSxMWettuTKFmF8Xr1DwH48cAv5pVjQlJvO0 dTXhbpDmVmH8q0L/FnBZMyQnrrNeYk+r0DlOIfIM3AfWFBnjHSA0Fq4eZ3iETn7iTUzy 2NOATw812uRT0TMHWy52kUHYzaFHfwZq3Aos5rSABYozCEKqbLdry4DH7eXqDz9CGugt C4zWkdSVKMYKq6eimrDo24DDKHPydy8cXqeaXUM3ADX6AZtq3RHVFefJLBn80xvgyfrr kM1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="K6u/pIec"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr14si765841ejc.744.2021.06.02.16.15.59; Wed, 02 Jun 2021 16:16:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="K6u/pIec"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229822AbhFBXQc (ORCPT + 99 others); Wed, 2 Jun 2021 19:16:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbhFBXQa (ORCPT ); Wed, 2 Jun 2021 19:16:30 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 516CFC06174A; Wed, 2 Jun 2021 16:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=+Z2iQYoHcJ27W7xRyN7L68l/ztKMEA8mYKYCaCL+K58=; b=K6u/pIecNJ1M3HnClPy8gjeS+N PWj5JBgkMj7oPADtRL+alHjFpVIKm0N+xkeUgDnJB/j8QrG5YEq67HltKObCvDKnXWkR/wVkNMVZB 4/qCX8WltZTdxCVMVzr/XV1nstgFNLeiKidBpTWc9WXtBQ8ytQxtTqJEkzvOTCaQbbrLE269vBeJO 5dZyoMjW9WmwXYCUb9yhMoEDRFf0aptG9seFviC4xLg60o3s1M6bETWWn2pRkiMm2nRxC1B2RrzS4 iEY4WY/8iig4HPSmEeD3DnTWgn4Fh9igmYst/izqeUbIt6/fJKkjResv96XS38UUU5Ozd3ZwV++O8 CG9egyXw==; Received: from [2601:1c0:6280:3f0::ce7d] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1loa4T-006Rln-Pw; Wed, 02 Jun 2021 23:14:45 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org, David Howells Subject: [PATCH 1/4] sh: convert xchg() to a statement expression Date: Wed, 2 Jun 2021 16:14:41 -0700 Message-Id: <20210602231443.4670-2-rdunlap@infradead.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210602231443.4670-1-rdunlap@infradead.org> References: <20210602231443.4670-1-rdunlap@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use a GCC statement expression (extension) for xchg(), as is done in other arches. Fixes this build warning: ../fs/ocfs2/file.c: In function 'ocfs2_file_write_iter': ../arch/sh/include/asm/cmpxchg.h:49:3: warning: value computed is not used [-Wunused-value] 49 | ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr)))) Fixes: e839ca528718 ("Disintegrate asm/system.h for SH") Signed-off-by: Randy Dunlap Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Cc: David Howells --- This is similar to a patch from Arnd for m68k: https://lore.kernel.org/linux-m68k/20201008123429.1133896-1-arnd@arndb.de/ arch/sh/include/asm/cmpxchg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-next-20210528.orig/arch/sh/include/asm/cmpxchg.h +++ linux-next-20210528/arch/sh/include/asm/cmpxchg.h @@ -46,7 +46,7 @@ extern void __xchg_called_with_bad_point }) #define xchg(ptr,x) \ - ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr)))) + ({(__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr)));}) /* This function doesn't exist, so you'll get a linker error * if something tries to do an invalid cmpxchg(). */