From: Borislav Petkov <bp@alien8.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Thor Thayer <thor.thayer@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
David Frey <dpfrey@gmail.com>,
Mark Rutland <mark.rutland@arm.com>,
Ingo Molnar <mingo@kernel.org>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: EDAC, altera: work around int-to-pointer-cast warnings
Date: Fri, 28 Sep 2018 10:16:34 +0200 [thread overview]
Message-ID: <20180928081634.GB20768@zn.tnic> (raw)
On Thu, Sep 27, 2018 at 12:09:26PM +0200, Arnd Bergmann wrote:
> The altera edac driver passes a token from a DT resource as
> resource_size_t into an SMC call, but casts it to an __iomem pointer
> and then a plain void pointer inbetween, mixing three or four
> incompatible types in the process. The compiler complains about
> one of the conversions:
>
> drivers/edac/altera_edac.c: In function 'altr_init_a10_ecc_block':
> drivers/edac/altera_edac.c:1053:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> base = (void __iomem *)res.start;
> ^
> drivers/edac/altera_edac.c: In function 'altr_edac_a10_probe':
> drivers/edac/altera_edac.c:2062:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> base = (void __iomem *)res.start;
>
> Using a static checker probably also notices the __iomem cast. Solving
> this properly isn't trivial, but simply casting to a 'uintptr_t' instead
> of 'void __iomem *' makes it less wrong and should avoid the warnings.
>
> Fixes: d5fc9125566c ("EDAC, altera: Combine Stratix10 and Arria10 probe functions")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/edac/altera_edac.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
Applied, thanks.
next reply other threads:[~2018-09-28 8:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-28 8:16 Borislav Petkov [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-09-27 17:23 EDAC, altera: work around int-to-pointer-cast warnings thor.thayer
2018-09-27 10:09 Arnd Bergmann
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=20180928081634.GB20768@zn.tnic \
--to=bp@alien8.de \
--cc=arnd@arndb.de \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dpfrey@gmail.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=mingo@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