From patchwork Thu Mar 1 15:27:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130289 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2952631edc; Thu, 1 Mar 2018 07:38:42 -0800 (PST) X-Google-Smtp-Source: AG47ELuGSbfuHEX8a7RyLnR8GmjOsOHlwuM4It65sUAah4aLWbBQeiwCxeNDMWhfT5BHhasM/PZA X-Received: by 2002:a17:902:7e0d:: with SMTP id b13-v6mr2266035plm.97.1519918722361; Thu, 01 Mar 2018 07:38:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918722; cv=none; d=google.com; s=arc-20160816; b=OPd/+lewEvikyOvbwRmsmE/1Q+y2cNNE84R20MMr+c0dfSOw5hQoVg3rR7Na5qlgJC Vbrxm+vg2U0ngmsUxt0jUL2NFvy/7Qt3hSzVVcvljxeE6FIfvSO/s5ynPm9bVThFL3I7 SDXdLtkXzX7dF56Cv0EqYWzjVY7fiqbAFB0gdp7GwTdT3ZultXtHE9apRGNoZpq6W+fn /EjMUBcrjwStAM9vDBxgFc19bkksDu5GTVbKNWBxSrcHQiZJM8Ol1F7PVWl2RLxQPSVy O3E5ZZ0Pi6Di/rboeBnjs3pV4ACIOIQCvTCu1Z2MUy7jtz+lqkqG+ojOz7SsQUB1riAD kYbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Z2extjuCvGn2xCHW2U8i+9YbgBPx1Q0Dl8VVhQyoh3k=; b=t9VWbgx89nP/OKcsdHUn2tIif9N6JK54/wFl6uxSqvca1ESDysv6MQu+IB/SW8ySg6 RK/bwjZUjvZO/IVXDwQOyaMiDb15Ih1ZhNX9FEwlpoV3/7zuY6NpbUDSleqAPWb98+Ca 54yfMtjfz+QO9992umhFAQIPEcN9gQsyT+DtkodhEM2ySbwTNKyjHpdFrhcKRPLV4t46 3wM+i1Zj0OxLINmx+D5FwRzwczTwHI1bzcH+CTzbI8d3IHapzNo9q5MVMRpIxJiKNkNB EOICU6J2TAY+GqaLfDlmS/VCebhCBPa5WcBdqvDY7Emy1Qo1Rrkvpprh8S8d1lm1z7pY xXUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=lV7SWX0j; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15si2586092pgs.318.2018.03.01.07.38.42; Thu, 01 Mar 2018 07:38:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=@microsoft.com header.s=selector1 header.b=lV7SWX0j; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032558AbeCAPij (ORCPT + 10 others); Thu, 1 Mar 2018 10:38:39 -0500 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Z2extjuCvGn2xCHW2U8i+9YbgBPx1Q0Dl8VVhQyoh3k=; b=lV7SWX0jakwpK9EhsiUwVOC6UmEMYoqUfV4SHWOCohR/RN34TwzbZ7ZvqDmJD93v/tqKZpaBHhP8aRhD9YWGrbfd91ztoUzSFVd9WnaK6e0BuK4drRP4Aei7Mrv5xbpZtchWuXg6SjnBjwrG+W5OFgROCYNvSSyjktL1U6orJn8= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1016.namprd21.prod.outlook.com (52.132.133.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Thu, 1 Mar 2018 15:38:27 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0567.006; Thu, 1 Mar 2018 15:38:27 +0000 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 Thread-Topic: [added to the 4.1 stable tree] target/user: Fix cast from pointer to phys_addr_t Thread-Index: AQHTsXHMe7o3IkAvVkmZXdUT8tPcWg== 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> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1016; 6:sNHuj98RjOFRNrDVz2CsItxPI8oHW6QEHLPq3vi8v8dtSK71sptU6UXEM8HLWSvcjCRU7hyeOifzuG06iAVu5eBD4iR86Wgo5o1Ij+6XY7f/0rUsZ1WEin7Hbba+d+vSrGrFlqERtZlMEt6KD3n5rsPmxTa2poTn8JIj22+5CPT2MOYq4ebdcj197xpJO7O4483yBdqZHbkNoXvJ72NQ9Hyfv7qH3Etewq4zQh9fP3kGzpcjWZLZ4Y+eqJPi9YS//itg/2uGprUtcVSqvKGCnKdjYZbPeClBfxWixqt1FJjJkAnGU6NB2VS2mL7dl3Q8Xcob1foMLMhpTR0tRzVjEjTaptvpB0uLNnccaDkFhLygsOAKfLxZyL47qfs8D38i; 5:Y1R+VrQVNAwtjLw1TCpBjX8tlmgcR8esbIw4BV8hfn+RSYyIoGZ/oQEVRmjD2agAjt5iunkPfiuiGCZ/k458ByDiklTyixljir8PeUt4xb4WtbxKvgqQaYD6Sbm1ruraWnksMCEqhq27wWsPHk1hhO6Ok7AdzUxchEYWLJSIlPs=; 24:pCOvpfzQRXIsThKpc40DGAjRCagJOe5CrXnwebPTa37xW9vBw1VKfbLAfdgDuD6e0GkH4lrcR9UiBrJtSD8HxNQNjdrkt+DwYz/RKv2Kn8Q=; 7:4olsvsHxyzPyoF0Msbs48Ih6qwbLyKDdyBf3vE4iZqXc206UTZSxAsh7iUUT6dBObvIpiAyR41+gMhcarJRzL9EUp1FnvrQKmW4hEdbApEbiztjDuQeKmzxBA6w0oqoq9y3z+Fv7BasZA2+XgVkbH24yfy6A8aZ3FQsvTJTHNX7OAhelrdZt0fsbq4CJHf8qxz6VR+mo1DkLGN6/DLnLKkodbPwbj0CLby47SDKuI4vUDbnxVnx+MEEUhPoq+sMC x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 28bcc873-edfa-406c-a3ef-08d57f8a7a2f x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:DM5PR2101MB1016; x-ms-traffictypediagnostic: DM5PR2101MB1016: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231220)(944501229)(52105095)(6055026)(61426038)(61427038)(6041288)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR2101MB1016; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1016; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(366004)(39860400002)(39380400002)(376002)(396003)(189003)(199004)(22452003)(6436002)(8676002)(81156014)(81166006)(53936002)(68736007)(6486002)(6512007)(97736004)(5660300001)(86362001)(59450400001)(6506007)(102836004)(6346003)(2906002)(26005)(186003)(4326008)(10290500003)(8936002)(76176011)(478600001)(105586002)(3280700002)(14454004)(54906003)(110136005)(3660700001)(2950100002)(305945005)(7736002)(6116002)(72206003)(1076002)(3846002)(6666003)(316002)(2900100001)(25786009)(36756003)(2501003)(66066001)(107886003)(106356001)(5250100002)(86612001)(99286004)(10090500001)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1016; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: P6NMtINLxV84IU7xAv1DS9/tpeR/STYEccoZ0bAxYGlyTSH+8fkB6Xq15gtxOnvZawdtSG25c9zz4DXHZ3V/gZ8TKgiE8VVpm2Q9HgEIqBBRagHTqgQQNCQBMdNYtSOZ6XGtBpeJQilqO6Q++aFVBImWpoc3N4zS4k/V23p1Szc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28bcc873-edfa-406c-a3ef-08d57f8a7a2f X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 15:27:24.5662 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1016 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. -- 2.14.1 =============== [ 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 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: 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 = xstr(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;