Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6016435ybc; Wed, 27 Nov 2019 13:27:40 -0800 (PST) X-Google-Smtp-Source: APXvYqySCjw3wc2jT6TG47uD94IYpsJSkVYYeuDy0LU+qv2poW3tcO1q/bCgy1LuZD0mYdFh+uxf X-Received: by 2002:a05:6402:1692:: with SMTP id a18mr34972190edv.297.1574890060522; Wed, 27 Nov 2019 13:27:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890060; cv=none; d=google.com; s=arc-20160816; b=echAQntuovkqgzUSBTDiuPC5FjAMi17vKdzuAqSPOjc96PF6c3iDnTZQnY5qOdfnue QXKxkNuFPhzZp3oVYqDjAwDXbVZKUhMM7SwfKRuhK5ebtRrSczhOcC3EIlqfp73HBuV5 AsYeJt+DV2nVfJWbow5eWD484t/2fVKeWP4aAyGiHtw4exl4g+b7PCZ+ou5gWFMaDisy q1l+AKeuxKuNo0LvpNcgNEeNJhnYwn58zTPJF06kTAy/wy1KCdqYcA1q7hgdUrZA+psq D/6UMmvy7Mm+Rfsn0wvDTZ2qmm6ZynqBdafiAxcJAd/MECc4/tiK8bfkZZ4gGGuI71WJ Y4Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DdJtji2pSuaEhoZWnHeoFY2wD2eh0vwH23MxKXpjTc8=; b=VS1oLcZJpeukRHHLHCS80ug7p9RKGFKhRqNorLLt+o7VAZN0p9wrW3XVe8Lhi4utGr 2EphCi0URVJ4Xp1px0NQq1+zVvUeX1CMTG1xhDRrY7TMJkVCWnUmUEeHIjdsoXnDY61Q 9L2eTIMsMIgy/Snvb8SpcCQZKx6UWxTaV36FaOPM+05l6I69A/vMPdoOstP9TjxgUP+z 5WfornelpA19fF8p3LFiRbKWLpgktiLsAcOGBgwvcywi6OIPdUHVAGJ3PAhnYBgSPrao fvGra98xyWh7KAO9L40sSL0RkZE9GpdssJH8bVam2n6BMqbefiqcg88V1DRErIDTADkD yuMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H34oYTGq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s46si13086758edd.336.2019.11.27.13.27.16; Wed, 27 Nov 2019 13:27:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H34oYTGq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732373AbfK0VZG (ORCPT + 99 others); Wed, 27 Nov 2019 16:25:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:54860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbfK0VCQ (ORCPT ); Wed, 27 Nov 2019 16:02:16 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 21DFD21741; Wed, 27 Nov 2019 21:02:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888535; bh=DjyCqwt1ga+lwVJAsjsS0ynYp2uQ2lXOueGsNp5OE3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H34oYTGqIdTesIm2xfkgUdtUFXeYnxT49/Uc3SFK2AwBiUS/ux65WMVzJb7OV4Z26 3XmOK2eFm/YFkAUfc1bvOMKl8w5V3PixvQWjOT2QN/jh4DoAY3vL9tb3dsFwBwH/xR rc8CzJoRj3EjQbFFwMZCjmTLWBCgJmazxscO+Egs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 145/306] sparc64: Rework xchg() definition to avoid warnings. Date: Wed, 27 Nov 2019 21:29:55 +0100 Message-Id: <20191127203125.953952831@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David S. Miller [ Upstream commit 6c2fc9cddc1ffdef8ada1dc8404e5affae849953 ] Such as: fs/ocfs2/file.c: In function ‘ocfs2_file_write_iter’: ./arch/sparc/include/asm/cmpxchg_64.h:55:22: warning: value computed is not used [-Wunused-value] #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) and drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c: In function ‘ixgbevf_xdp_setup’: ./arch/sparc/include/asm/cmpxchg_64.h:55:22: warning: value computed is not used [-Wunused-value] #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- arch/sparc/include/asm/cmpxchg_64.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/sparc/include/asm/cmpxchg_64.h b/arch/sparc/include/asm/cmpxchg_64.h index f71ef3729888f..316faa0130bab 100644 --- a/arch/sparc/include/asm/cmpxchg_64.h +++ b/arch/sparc/include/asm/cmpxchg_64.h @@ -52,7 +52,12 @@ static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long return val; } -#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) +#define xchg(ptr,x) \ +({ __typeof__(*(ptr)) __ret; \ + __ret = (__typeof__(*(ptr))) \ + __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))); \ + __ret; \ +}) void __xchg_called_with_bad_pointer(void); -- 2.20.1