Received: by 10.223.185.116 with SMTP id b49csp1129343wrg; Fri, 23 Feb 2018 12:26:55 -0800 (PST) X-Google-Smtp-Source: AH8x224eVTuNjH9vEqjzDJCJADW5I91FTWkNT36aOBoh9rSVs6Kw8pwKWt0rBOYXIi9v0J/rNeHu X-Received: by 2002:a17:902:64d7:: with SMTP id y23-v6mr2782498pli.258.1519417615320; Fri, 23 Feb 2018 12:26:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519417615; cv=none; d=google.com; s=arc-20160816; b=K8IMPBvZ7oKcy9ef3fhttUZZL/dZQDvt8sRaUhaeA3Z04+grAsbe6TEZNPWNgtwiL7 gtndDZEwUn5hyJlOf2V4D7S8/6jqL63iMbx1hylE7It37tctSH1yKDjmfjFqN4cRe3II D3nWBM71s5EfEdzukk8RmDeYttH0DW1ikQMf78oUQdgXAOP/Rk0JaefUV168+zcsAcaL /V5shAZvHcf7HFkHf/sCD5+PK6JicOaN23Y8+FtELF+iI3zYIBytFz10hUFj3W7qbdj7 4QCTe2DsKa1+3mHgg8ao55yYShrQhcIra2o+NWMuM3nhyguAMcQINTVtyZ6I1FCsEItY iFnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=T4WhMjlXCaHHlxvHITY9q7PkdHMmJHI+5JlwgU7EcMo=; b=UqlE2xy0N+7XnwIitVr2rrdq0ZdHaUv+3Ocpf8YKe9rBcQuSX0D4ZKhRHEA3nEwgYm txd6vxReXGfBhze4PleWgBOfaC35Lz5cDDq90Sd86WZubjGjH0EJ96NEO8Nr+K/Tb+rF 3YJX78pP+jldxJWLG7IHGMV3fOisUapzaM7yy82PCKv+cXE1qUzfsyazARW42rz5cuDN WlFc+et/En+ogsQnnv9yWQC6s4iHCRS8JzhZkUY6Lo/Upr67G3K25L7Z7ooRUg+4BTz+ /oWsADMBfL43b9cBQyuZcrkpnFlMUOndXVdzhS+6AY7S3pFl5x7iSmFGa8WYu/bhiDsA kjEw== 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 206si1859706pgb.647.2018.02.23.12.26.40; Fri, 23 Feb 2018 12:26:55 -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 S1754237AbeBWSha (ORCPT + 99 others); Fri, 23 Feb 2018 13:37:30 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38688 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753881AbeBWSh2 (ORCPT ); Fri, 23 Feb 2018 13:37:28 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4F9D6BBF; Fri, 23 Feb 2018 18:37:27 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Nicholas Bellinger Subject: [PATCH 4.4 102/193] target/user: Fix cast from pointer to phys_addr_t Date: Fri, 23 Feb 2018 19:25:35 +0100 Message-Id: <20180223170341.943894631@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 0633e123465b61a12a262b742bebf2a9945f7964 upstream. 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 Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- drivers/target/target_core_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c @@ -900,7 +900,7 @@ static int tcmu_configure_device(struct 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;