From patchwork Mon Mar 1 16:09:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 388732 Delivered-To: patch@linaro.org Received: by 2002:a02:290e:0:0:0:0:0 with SMTP id p14csp3655570jap; Mon, 1 Mar 2021 12:05:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPKeob4Do6XUuZYMbxg7VP6yH5y6wO19IK2ZB6Sut5fXzrOVZUwfDJNpJmXJd5gPnzLsSa X-Received: by 2002:aa7:dd4b:: with SMTP id o11mr18054761edw.303.1614629150507; Mon, 01 Mar 2021 12:05:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614629150; cv=none; d=google.com; s=arc-20160816; b=TOgVvhlCA9A9Iqi5B+C2fHNI05ohqfObhx5o3z81NcML/IvQc01ssZL2eY/GOu6HvP KD5/NcIxsasW9K3jsQUEhcSsQMQeHUI+a/ZAVmkJ9KgQaibDNaqpAW1gFvtldDNGQBuu MVAiKUSHj+kiNSkUP1jQlx3wkuShqRSo53kvGLeZCQ80VeXxCHw+nBOp7racbPZBSU18 adujqaIFmCtmsK26ktrvIMBkbcGNtkrf3CNGq949U+kPCIkwmY3En8AUSqh5jju8gxmj HqYZQpHl418lTPQVTAZei3If3CxithMK/CSw6ftfSiCjlt5Y0r9DWRKi7dQrOIHS7Sbl kOAQ== 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=+yoXgjmekKOvv5nAWwzoopeSDKUVtYjqfipNA3jc/1o=; b=Gxu18EEeae5Z15x0dfNspZQZ7G7pCEUGmtnZmuWqVSiknzlHJEKUiHznM8t9T7YTXh g4fxEz48Cb/NzAfP9W6n8ic1yhnH0UB88jI87hV2ERxcrLh9LAIaDteJ1h6bh4CrMYoW zCeqk+uZBmN0Mqd84f0W2Blc96eJDb/OGM7poGuVZW1Gct3lPX4/HZfkB5H3QsJVbXcu 3Pu5ryuNgCdIBPXc7byO89pHi1IkouyM2G0FY+NNGOYcOIK7MuFMJR0j4REe8FL0G15k 01Tjlmt9uxfdVQZTvcHNf8yG+WDJydlhhfd1PifTtq5ntJW5R0OC5lPGqZKLXg0XEFPD aQhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YJSV+DIP; 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 w21si11696186edd.421.2021.03.01.12.05.50; Mon, 01 Mar 2021 12:05:50 -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=YJSV+DIP; 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 S242666AbhCAUDI (ORCPT + 13 others); Mon, 1 Mar 2021 15:03:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:58658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242067AbhCATw3 (ORCPT ); Mon, 1 Mar 2021 14:52:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2954E650EF; Mon, 1 Mar 2021 17:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614621174; bh=eCg/lIjEM+W/uBZZrji2wyLg8gsCtmA7cM7v0jv6DWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YJSV+DIPagf8QK8VS6u2Gharf5Y2w+i8uZGS0Pwo6BhSyY08KZVAu1yfv8aM5CJt6 ACDWEE1bhTh47OzsnL2rWxBvXxaucgIIABp+3q+Fzgq7FIxxjja/bndz/EF9EFjZqj x9ahhnBF9s08ycufoifrVOzUwDBFZlxAhaVNe8Nc= 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.11 420/775] mfd: altera-sysmgr: Fix physical address storing more Date: Mon, 1 Mar 2021 17:09:48 +0100 Message-Id: <20210301161222.335127993@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161201.679371205@linuxfoundation.org> References: <20210301161201.679371205@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 193a96c8b1eab..20cb294c75122 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));