linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* edac: altera: Fix ARM64 warning
@ 2018-05-14 17:04 thor.thayer
  0 siblings, 0 replies; 2+ messages in thread
From: thor.thayer @ 2018-05-14 17:04 UTC (permalink / raw)
  To: bp, mchehab, mark.rutland, catalin.marinas, will.deacon
  Cc: thor.thayer, linux-arm-kernel, linux-edac

From: Thor Thayer <thor.thayer@linux.intel.com>

The kbuild test robot reported the following warning on altera_edac.c:

drivers//edac/altera_edac.c: In function 'ocram_free_mem':
drivers//edac/altera_edac.c:1410:42: warning: cast from pointer to integer
      of different size [-Wpointer-to-int-cast]
  gen_pool_free((struct gen_pool *)other, (u32)p, size);
                                           ^^^
After adding support for ARM64 architectures, the unsigned long parameter
is 64bits and causes a build warning with arm64-allyesconfig
Fix by casting to the correct size (unsigned long) instead of u32.

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: c3eea1942a16 ("EDAC, altera: Add Altera L2 cache and OCRAM support")
Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
---
 drivers/edac/altera_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index 5672f6718262..c5104ea7e1fb 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -1415,7 +1415,7 @@ static void *ocram_alloc_mem(size_t size, void **other)
 
 static void ocram_free_mem(void *p, size_t size, void *other)
 {
-	gen_pool_free((struct gen_pool *)other, (u32)p, size);
+	gen_pool_free((struct gen_pool *)other, (unsigned long)p, size);
 }
 
 static const struct edac_device_prv_data ocramecc_data = {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* edac: altera: Fix ARM64 warning
@ 2018-05-15  9:23 Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2018-05-15  9:23 UTC (permalink / raw)
  To: thor.thayer
  Cc: mchehab, mark.rutland, catalin.marinas, will.deacon,
	linux-arm-kernel, linux-edac

On Mon, May 14, 2018 at 12:04:01PM -0500, thor.thayer@linux.intel.com wrote:
> From: Thor Thayer <thor.thayer@linux.intel.com>
> 
> The kbuild test robot reported the following warning on altera_edac.c:
> 
> drivers//edac/altera_edac.c: In function 'ocram_free_mem':
> drivers//edac/altera_edac.c:1410:42: warning: cast from pointer to integer
>       of different size [-Wpointer-to-int-cast]
>   gen_pool_free((struct gen_pool *)other, (u32)p, size);
>                                            ^^^
> After adding support for ARM64 architectures, the unsigned long parameter
> is 64bits and causes a build warning with arm64-allyesconfig
> Fix by casting to the correct size (unsigned long) instead of u32.
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Fixes: c3eea1942a16 ("EDAC, altera: Add Altera L2 cache and OCRAM support")
> Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
> ---
>  drivers/edac/altera_edac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-15  9:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-14 17:04 edac: altera: Fix ARM64 warning thor.thayer
  -- strict thread matches above, loose matches on Subject: below --
2018-05-15  9:23 Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).