From patchwork Mon Feb 1 16:29:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101005 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp127071lbb; Mon, 1 Feb 2016 08:30:34 -0800 (PST) X-Received: by 10.66.132.81 with SMTP id os17mr38996211pab.98.1454344234264; Mon, 01 Feb 2016 08:30:34 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id or3si25136982pac.233.2016.02.01.08.30.33; Mon, 01 Feb 2016 08:30:34 -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; 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 S1754089AbcBAQa3 (ORCPT + 30 others); Mon, 1 Feb 2016 11:30:29 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:59411 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753911AbcBAQaZ (ORCPT ); Mon, 1 Feb 2016 11:30:25 -0500 Received: from wuerfel.localnet ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0MaaU5-1afTl73JbV-00K8q2; Mon, 01 Feb 2016 17:29:48 +0100 From: Arnd Bergmann To: "Nicholas A. Bellinger" Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, "Hans J. Koch" , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] target: fix cast from pointer to phys_addr_t Date: Mon, 01 Feb 2016 17:29:45 +0100 Message-ID: <3114027.BKdWsaRxO0@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:UcwTOeVKqr56I1D2So8cXPVpLZMRdd5xiOicooonas8HzzBFOGU F68v4hp8Xmc2M6TgYZ3dqjPV9/xVtm2tzUi3HEGQQH1f8kzXcwm8ngC1sUXww8AWUOXuuys epgbi3hhONIOy0AvwDNP2M0FzmY33oN0h4EUo5SIkGBmrA3TQN0E6LhSSNs3gZHt4bWD2hD vX9wb2DPqXAwlb9TF0e0Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:qpYDWgeRlis=:nJeW3fkb/WluFWWA41k/eu pzFNEPavWlca16Jwo0s+9wfhrbwrtGPxVIfPjbBZxnKZJZCRGK705lC6zNmjU52h6Fo0d+ndv Kja19WHR3bKc+vvrWnimJ9y2aQUPgD2VSGY7I0SIeq+38aGym3D5hfLFISTDsdGgMYzIIo0sG xgeSu6cKBepLI1RpXU4mEKE2WGV1hJfClZjhajSk3EAmqz+rsZNKcIjQLi41WSgzWc1JDa8cR v6Djtp//Fi++HUl8zo48/y9cm9Y/10nDM2j/02uRpHGhsP6+WZCXPqrCAEw4ku3vi01J9+qhs jikH4W6eeFF3cmbmr48eTEHa2wODx05fnvZVr4Z9vbu+uOOs6ePlP5MDie1zkDs+BkPOnIJg8 uBJ7canESL5bDzXr//q7ItFsCaLuJp4qIp/c6PFQPaKtLWZIlPWlsu/77I3ziRVCE8pFbCYb1 jRWrbZJFOL9TOHW+olgGSezU8UY3fOsgnMwe70hA2JCMgpBoi2Fe8xvSq/xeWgdLR7FG9hahV j5c0V9UNoUQGYQnvNvkpKiV5yOUzggbOPzcWF9ThgFCdXbtNSb4k7kLDUyKqQvaRm2eMq0iee fbzQFK8ZxveoLM1pios0PWZTsGGKfjH9CLSnOLSdVAMgtU3DFScpHFV3gnBvcACcQhCHCuSTD N8ai4i6u2mkVTpixnnHOOp7vOF6y1UCV0WY8TMj1DdW84HHTPgYypYTVRn0qiZdKNEEFzFicp a6xrhZE/H6JZYDC1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 integer of different size [-Werror=pointer-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 --- This has been around for a long while, but did not trigger in my randconfig testing until now, don't know why. diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index dd600e5ead71..94f5154ac788 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -903,7 +903,7 @@ static int tcmu_configure_device(struct se_device *dev) info->version = __stringify(TCMU_MAILBOX_VERSION); info->mem[0].name = "tcm-user command & data buffer"; - info->mem[0].addr = (phys_addr_t) udev->mb_addr; + info->mem[0].addr = (phys_addr_t)(uintptr_t)udev->mb_addr; info->mem[0].size = TCMU_RING_SIZE; info->mem[0].memtype = UIO_MEM_VIRTUAL;