public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Thor Thayer <thor.thayer@linux.intel.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: altera-sysmgr: Fix physical address storing more
Date: Wed, 16 Dec 2020 08:46:54 +0000	[thread overview]
Message-ID: <20201216084654.GE4776@dell> (raw)
In-Reply-To: <20201203225252.1476897-1-arnd@kernel.org>

On Thu, 03 Dec 2020, Arnd Bergmann wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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 <arnd@arndb.de>
> ---
>  drivers/mfd/altera-sysmgr.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

      reply	other threads:[~2020-12-16  8:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 22:52 [PATCH] mfd: altera-sysmgr: Fix physical address storing more Arnd Bergmann
2020-12-16  8:46 ` Lee Jones [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201216084654.GE4776@dell \
    --to=lee.jones@linaro.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thor.thayer@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox