[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180928081634.GB20768@zn.tnic>
Date: Fri, 28 Sep 2018 10:16:34 +0200
From: Borislav Petkov <bp@...en8.de>
To: Arnd Bergmann <arnd@...db.de>
Cc: Thor Thayer <thor.thayer@...ux.intel.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
David Frey <dpfrey@...il.com>,
Mark Rutland <mark.rutland@....com>,
Ingo Molnar <mingo@...nel.org>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] EDAC, altera: work around int-to-pointer-cast warnings
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@...db.de>
> ---
> drivers/edac/altera_edac.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
Applied, thanks.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists