mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] soc: loongson: loongson2_pm: Fix build warnings for 32BIT
@ 2026-10-19 14:42 Huacai Chen
  2026-10-19 22:18 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Huacai Chen @ 2026-10-19 14:42 UTC (permalink / raw)
  To: Arnd Bergmann, Huacai Chen
  Cc: loongarch, Yinbo Zhu, Xuefeng Li, Guo Ren, Xuerui Wang,
	Jiaxun Yang, linux-kernel, Huacai Chen, stable,
	kernel test robot

Since loongson_sysconf.suspend_addr is unsigned long, use "unsigned
long" instead of "u64" for casting, so as to avoid build warnings for
32BIT:

   drivers/soc/loongson/loongson2_pm.c: In function 'loongson2_pm_probe':
>> drivers/soc/loongson/loongson2_pm.c:178:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     178 |                 loongson_sysconf.suspend_addr = (u64)phys_to_virt(suspend_addr);
         |

Cc: stable@vger.kernel.org
Fixes: 3d9aba6618d1 ("LoongArch: Adjust build infrastructure for 32BIT/64BIT")
Closes: https://lore.kernel.org/oe-kbuild-all/202610190549.WM2PO3vO-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 drivers/soc/loongson/loongson2_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/loongson/loongson2_pm.c b/drivers/soc/loongson/loongson2_pm.c
index b8e5e1e3528a..1e2c897d055b 100644
--- a/drivers/soc/loongson/loongson2_pm.c
+++ b/drivers/soc/loongson/loongson2_pm.c
@@ -175,7 +175,7 @@ static int loongson2_pm_probe(struct platform_device *pdev)
 		return irq;
 
 	if (!device_property_read_u64(dev, "loongson,suspend-address", &suspend_addr))
-		loongson_sysconf.suspend_addr = (u64)phys_to_virt(suspend_addr);
+		loongson_sysconf.suspend_addr = (unsigned long)phys_to_virt(suspend_addr);
 	else
 		dev_err(dev, "No loongson,suspend-address, could not support S3!\n");
 
-- 
2.52.0


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

* Re: [PATCH] soc: loongson: loongson2_pm: Fix build warnings for 32BIT
  2026-10-19 14:42 [PATCH] soc: loongson: loongson2_pm: Fix build warnings for 32BIT Huacai Chen
@ 2026-10-19 22:18 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2026-10-19 22:18 UTC (permalink / raw)
  To: Huacai Chen, Huacai Chen
  Cc: loongarch, Yinbo Zhu, Xuefeng Li, guoren, WANG Xuerui,
	Jiaxun Yang, linux-kernel, stable, kernel test robot

On Mon, Oct 19, 2026, at 16:42, Huacai Chen wrote:
> Since loongson_sysconf.suspend_addr is unsigned long, use "unsigned
> long" instead of "u64" for casting, so as to avoid build warnings for
> 32BIT:
>
>    drivers/soc/loongson/loongson2_pm.c: In function 'loongson2_pm_probe':
>>> drivers/soc/loongson/loongson2_pm.c:178:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>      178 |                 loongson_sysconf.suspend_addr = 
> (u64)phys_to_virt(suspend_addr);
>          |
>
> Cc: stable@vger.kernel.org
> Fixes: 3d9aba6618d1 ("LoongArch: Adjust build infrastructure for 
> 32BIT/64BIT")
> Closes: 
> https://lore.kernel.org/oe-kbuild-all/202610190549.WM2PO3vO-lkp@intel.com/
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

Feel free to pick that up through the loongarch tree, or send it to
soc@linux.linux.dev if you prefer us to pick it up through the soc tree.

      Arnd

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

end of thread, other threads:[~2026-10-19 22:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-19 14:42 [PATCH] soc: loongson: loongson2_pm: Fix build warnings for 32BIT Huacai Chen
2026-10-19 22:18 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®