From patchwork Fri May 25 15:50:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 136954 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3758728lji; Fri, 25 May 2018 08:51:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpJd4HiOSITn+N+JV6wglg5MNbXQ8cvA1kyw1ZNUMgh4L8cuCn2wAbUXdB0/T2pqLyt9S7P X-Received: by 2002:a17:902:7883:: with SMTP id q3-v6mr3202587pll.71.1527263502501; Fri, 25 May 2018 08:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527263502; cv=none; d=google.com; s=arc-20160816; b=ISjaabbjSmHUXBVeoTEWxvxcU3MzEDJbK4W7n0QynWS7nG4yk7UXbPk/6do3hIeMnU ecM+Fuje0Li0Xx8dDvgeYjZbRRDj+SCn8BtODSSz9JjOvSqnlSMNuwQgZRRCji7IVqJ7 EZ19HqroeiSTTGllVu0sAiedhBxlJj9UE153mAuRy5TBkgcjfYH/frplZQJ7QHaxXh68 P9i4QMgqsub4sInkWH3Qc2OFkhm4mBHHns6Omu4vFmAEi803JURBmMeICX1fNbvzf+/n eChev8xTy3g3BW03LRu1iwv8pHZzTgd/oGZQv24WdBziDgwS07nHdUdXNn9DK2bUciQR s5yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=NG+33xHtW5FWb+DYG8hT35iBPrdq+McC+LHfhVHADNo=; b=EB6jDTxLsK+60H7cqljiN4FOVImDjmYycO5nsphqTXK9jhx9JzlqIhXJSPMt8qh62y 2P/WQRKajyaZg/6LR/qGErDtNbyC0B3RpE1p78B/OwI4eMnX9ZpYViBK63xGHwoaPS85 ykpxKKDW78dBxS8GyieaVNHU+I36UuIRsmeWKP+PDkBvjCNPm+V+IQWMEFTpUhkSB4XG Omd58sVl/4SUexNmBWD5kQkOt8VOQxh/nYSUW5RxQmDlTfsitWv0SLaj8kFCb1x120T9 8hohs0dngf/gTtAZGDm0jLqb6vy8qHNY6EVp0wNQmeWxm/vyo/it0Qgg/nnsoHUunbPv GbaA== ARC-Authentication-Results: i=1; mx.google.com; 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 k9-v6si19068400pgo.340.2018.05.25.08.51.42; Fri, 25 May 2018 08:51:42 -0700 (PDT) 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; 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 S966958AbeEYPvk (ORCPT + 30 others); Fri, 25 May 2018 11:51:40 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:42297 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965666AbeEYPvj (ORCPT ); Fri, 25 May 2018 11:51:39 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.145]) with ESMTPA (Nemesis) id 0LvAri-1gMYtu12iw-010MMW; Fri, 25 May 2018 17:51:28 +0200 From: Arnd Bergmann To: Oleksandr Andrushchenko , David Airlie Cc: Arnd Bergmann , Daniel Vetter , Boris Ostrovsky , Dan Carpenter , dri-devel@lists.freedesktop.org, xen-devel@lists.xen.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/8] drm/xen-front: fix 32-bit build warning Date: Fri, 25 May 2018 17:50:10 +0200 Message-Id: <20180525155030.3667352-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180525155030.3667352-1-arnd@arndb.de> References: <20180525155030.3667352-1-arnd@arndb.de> X-Provags-ID: V03:K1:ddItXKM++H9uoM10jODuwDQmtzeUlfdXwaNe+h8Gc45QuVb0Vjv vj8p5lfr9ZUYWoZi5rIzYdO+S0EwAiSLJrbHSBGntelCdaI5GcOO0T0tpSr6xD2IrVD4VIf +G4B4Qno+W4OMy0OFaP3oRbWLgVciurqY9PPvb/pxJrM6Z/ZuRYHOz8BOtYlg/XU/vtBj3S RzNFOSMsWuLZMQZ8xo/5Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:GVuNtDLgXEs=:MZa0Sr4rSDFUigfEOJjDRW 5b88AJTYzyeyOwri29jS2qCSg7gjHwCPLbtrWEe9lXm0+8NIDBO0xmUkLijeBKOg9rRc/nTXR JiFteRLzTVSeJiwqMmLsK8hOMu7JLfJ2vYrEkKf0VqB19cFZ7qvZBrR9vENfDHLb57aeLB+4x f2wMChkD3lOAuSk3XOmx05Qh18YgV0cc2qf6Gxcy2tiajYU+j0cgrdoUov11JaizoyqlkvJz5 l+5jENN11PP8lpE9w9g8L4U8HPCS5qN3CIr57T5lxVB1Sbkx9mIpP3emCryhgXn+eJ3BzzdTe v7uGxjTBViRvJ7RoO/I+vImMjBICg98bmNv+uBG6fEkwWu4E9LvCma8e5povV5uQtNrvxoqbR w5hcvZ74dIGQbR4vFraBcVnrmeXly5pfwSvH9k25pGl426+POoX2fIv4kzsdQeE3NukdyBazE WPeFHxpFliRJ4qniixeyNuPhiX+sIWT9pRdnARpZ66ZURSDY3Gten0RV13YiXUezHkcGGt+r+ eRy7Bfch9vinQGszqPOYH2KoNgEWfbq32+7kwdFTrpH27WMeuxk3O9B94VTrNaBy66AgSoNvZ E9fL+LakVFjl6xnC3FfdJpQKjsv485d4HoztJe3GTBGOpblfmQji0N900k/yj1AEIEgh0Mfwo 0kLlzklYn52RqwsHa0XmEDOtOc1Y+H7PyIH98yP3Yb4nUTozdftlxMDvEMI/OF0YKdUs= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In 32-bit kernel builds, we cannot cast between a pointer and a 64-bit type: In file included from drivers/gpu/drm/xen/xen_drm_front_cfg.c:18: drivers/gpu/drm/xen/xen_drm_front.h: In function 'xen_drm_front_fb_to_cookie': drivers/gpu/drm/xen/xen_drm_front.h:129:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] return (u64)fb; drivers/gpu/drm/xen/xen_drm_front.h: In function 'xen_drm_front_dbuf_to_cookie': drivers/gpu/drm/xen/xen_drm_front.h:134:9: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] return (u64)gem_obj; drivers/gpu/drm/xen/xen_drm_front_shbuf.c: In function 'backend_unmap': drivers/gpu/drm/xen/xen_drm_front_shbuf.c:125:4: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] ((phys_addr_t)pfn_to_kaddr(page_to_xen_pfn(page))) Using uintptr_t instead probably does what we want here, although it's not clear to me why we assign a virtual address pointer to a phys_addr_t in backend_unmap(). Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/xen/xen_drm_front.h | 4 ++-- drivers/gpu/drm/xen/xen_drm_front_shbuf.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/drivers/gpu/drm/xen/xen_drm_front.h b/drivers/gpu/drm/xen/xen_drm_front.h index 2c2479b571ae..5693b4a4b02b 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.h +++ b/drivers/gpu/drm/xen/xen_drm_front.h @@ -126,12 +126,12 @@ struct xen_drm_front_drm_info { static inline u64 xen_drm_front_fb_to_cookie(struct drm_framebuffer *fb) { - return (u64)fb; + return (uintptr_t)fb; } static inline u64 xen_drm_front_dbuf_to_cookie(struct drm_gem_object *gem_obj) { - return (u64)gem_obj; + return (uintptr_t)gem_obj; } int xen_drm_front_mode_set(struct xen_drm_front_drm_pipeline *pipeline, diff --git a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c index 8099cb343ae3..d333b67cc1a0 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c +++ b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c @@ -122,7 +122,7 @@ static void guest_calc_num_grefs(struct xen_drm_front_shbuf *buf) } #define xen_page_to_vaddr(page) \ - ((phys_addr_t)pfn_to_kaddr(page_to_xen_pfn(page))) + ((uintptr_t)pfn_to_kaddr(page_to_xen_pfn(page))) static int backend_unmap(struct xen_drm_front_shbuf *buf) {