From patchwork Mon Mar 1 16:09:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 388681 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp3578095jap; Mon, 1 Mar 2021 10:15:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9XNbUmcxGgKjq7wPGRNURaZ+nEMYRvW+ueP/4v6ZDVA8jI/wGmmXazWe21b/uuM9oLOvF X-Received: by 2002:a17:906:a090:: with SMTP id q16mr17078436ejy.236.1614622437546; Mon, 01 Mar 2021 10:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614622437; cv=none; d=google.com; s=arc-20160816; b=KVmubqRBipO/MCwpof+SskqPgzeYQvx/BRGS3FCsU6X1laSHfTqbrWumdGNLuQeRun m1E0e02wLy34zjQNdMh08wJ41DwSP5pMYPtW7SXs/gaQJKKffPaNhAhO4o8G06YfvvS6 frQLX9m7lnFju/1pzUpFXRGRGuVGUTME6meKcKBSVmoOSIOgLiaCfHy0xY38rRWaCHlj /u4rbhmhq8WbG4Txdqrdddi6U2D2ztdrSauCtBl5gxQL8aNLauhIhSURqOAg14pGxOOF i/4CY7B6lW81qRyNBgi/9WGAFw7FGo8tV0qRodpVSwMwgbuUYtdR4xuTIVs+7yRgYdLI epaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cG1i4o5VNjE+tUFxvRnn0j07/8lx8MTWg/K6JKD9JAs=; b=gJRFO2XaWZgKXfRFWV1VMsfTHo0fXMz4M4XCyZUDBn0zshiw/O6N5XJIfkIm3dhkbh zsG3+kawt2gbXE8P5d5ObFegr/dJcz5GLfrToWns1ljD9mTGgUAqtcf/Sn2fCK8LoGCh fIzCcrJI6BQx27Km9k8TQGyXgVQuY8eY8ykCgT9kKnsgQfRHCIz+/vZhuQp2WU8ktf9h fhnqjUx830Vh/NqC1oCker/qF8yZpFQk4E1HyrkmaXMx2hJxPyX7d7H8aIAerGaIXsDl vSbi9Fk0DPNuz65eYr64wpXyYmeLgoMySkz9FEXMQlsbODt79Khif9dOsx0jlb3K4KdC f3yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wkph/Mk0"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du19si11830120ejc.206.2021.03.01.10.13.57; Mon, 01 Mar 2021 10:13:57 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wkph/Mk0"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239495AbhCASNM (ORCPT + 13 others); Mon, 1 Mar 2021 13:13:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:59384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238947AbhCASHU (ORCPT ); Mon, 1 Mar 2021 13:07:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 53AC6651E7; Mon, 1 Mar 2021 17:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619147; bh=RzofuUKyN9DwFW2Y0fKdA4U9YIA7AaYiv9uS/HSHnCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wkph/Mk0IR2l6SsbWc7B4k7J3Wrs+0V2So4OPYLQ6nf8cjoHS30MNwrHDUoiRw7Bp d2zpVgoKJQDLllx6vajzODFYMdNCZBPUBE/AiFFekanQqVvjV5z4ZJHXOe4Dugxn8l ZZN5tq+KbyqJzkE/8SIajU4zpu4axEmp3O6jhhh8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Lee Jones , Sasha Levin Subject: [PATCH 5.10 349/663] mfd: altera-sysmgr: Fix physical address storing more Date: Mon, 1 Mar 2021 17:09:57 +0100 Message-Id: <20210301161159.116709424@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit b0b5b16b78cea1b2b990a69ab8e07a42ccf7a2ed ] A recent fix improved the way the resource gets passed to the low-level accessors, but left one warning that appears in configurations with a resource_size_t that is wider than a pointer: In file included from drivers/mfd/altera-sysmgr.c:19: drivers/mfd/altera-sysmgr.c: In function 'sysmgr_probe': drivers/mfd/altera-sysmgr.c:148:40: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 148 | regmap = devm_regmap_init(dev, NULL, (void *)res->start, | ^ include/linux/regmap.h:646:6: note: in definition of macro '__regmap_lockdep_wrapper' 646 | fn(__VA_ARGS__, &_key, \ | ^~~~~~~~~~~ drivers/mfd/altera-sysmgr.c:148:12: note: in expansion of macro 'devm_regmap_init' 148 | regmap = devm_regmap_init(dev, NULL, (void *)res->start, | ^~~~~~~~~~~~~~~~ I had tried a different approach that would store the address in the private data as a phys_addr_t, but the easiest solution now seems to be to add a double cast to shut up the warning. As the address is passed to an inline assembly, it is guaranteed to not be wider than a register anyway. Fixes: d9ca7801b6e5 ("mfd: altera-sysmgr: Fix physical address storing hacks") Signed-off-by: Arnd Bergmann Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/altera-sysmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.27.0 diff --git a/drivers/mfd/altera-sysmgr.c b/drivers/mfd/altera-sysmgr.c index 41076d121dd54..591b300d90953 100644 --- a/drivers/mfd/altera-sysmgr.c +++ b/drivers/mfd/altera-sysmgr.c @@ -145,7 +145,8 @@ static int sysmgr_probe(struct platform_device *pdev) sysmgr_config.reg_write = s10_protected_reg_write; /* Need physical address for SMCC call */ - regmap = devm_regmap_init(dev, NULL, (void *)res->start, + regmap = devm_regmap_init(dev, NULL, + (void *)(uintptr_t)res->start, &sysmgr_config); } else { base = devm_ioremap(dev, res->start, resource_size(res));