From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam02on0127.outbound.protection.outlook.com ([104.47.36.127]:60979 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032557AbeCAPid (ORCPT ); Thu, 1 Mar 2018 10:38:33 -0500 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , Nicholas Bellinger , Sasha Levin Subject: [added to the 4.1 stable tree] target/user: Fix cast from pointer to phys_addr_t Date: Thu, 1 Mar 2018 15:27:24 +0000 Message-ID: <20180301152116.1486-460-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ Upstream commit 0633e123465b61a12a262b742bebf2a9945f7964 ] The uio_mem structure has a member that is a phys_addr_t, but can be a number of other types too. The target core driver attempts to assign a pointer from vmalloc() to it, by casting it to phys_addr_t, but that causes a warning when phys_addr_t is longer than a pointer: drivers/target/target_core_user.c: In function 'tcmu_configure_device': drivers/target/target_core_user.c:906:22: error: cast from pointer to integ= er of different size [-Werror=3Dpointer-to-int-cast] This adds another cast to uintptr_t to shut up the warning. A nicer fix might be to have additional fields in uio_mem for the different purposes, so we can assign a pointer directly. Signed-off-by: Arnd Bergmann Signed-off-by: Nicholas Bellinger Signed-off-by: Sasha Levin --- drivers/target/target_core_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core= _user.c index 39e8f22be68b..b2edb5f6e6b9 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -860,7 +860,7 @@ static int tcmu_configure_device(struct se_device *dev) info->version =3D xstr(TCMU_MAILBOX_VERSION); =20 info->mem[0].name =3D "tcm-user command & data buffer"; - info->mem[0].addr =3D (phys_addr_t) udev->mb_addr; + info->mem[0].addr =3D (phys_addr_t)(uintptr_t)udev->mb_addr; info->mem[0].size =3D TCMU_RING_SIZE; info->mem[0].memtype =3D UIO_MEM_VIRTUAL; =20 --=20 2.14.1