[PATCH] arm64: hibernate: Fix warning for cast from restricted gfp_t

Min-Hua Chen posted 1 patch 2 months, 2 weeks ago
arch/arm64/kernel/hibernate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] arm64: hibernate: Fix warning for cast from restricted gfp_t
Posted by Min-Hua Chen 2 months, 2 weeks ago
This patch fixes the following warning by adding __force
to the cast:
arch/arm64/kernel/hibernate.c:410:44: sparse: warning: cast from restricted gfp_t

No functional change intended.

Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
---
 arch/arm64/kernel/hibernate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/hibernate.c b/arch/arm64/kernel/hibernate.c
index 02870beb271e..7b11d84f533c 100644
--- a/arch/arm64/kernel/hibernate.c
+++ b/arch/arm64/kernel/hibernate.c
@@ -407,7 +407,7 @@ int swsusp_arch_resume(void)
 					  void *, phys_addr_t, phys_addr_t);
 	struct trans_pgd_info trans_info = {
 		.trans_alloc_page	= hibernate_page_alloc,
-		.trans_alloc_arg	= (void *)GFP_ATOMIC,
+		.trans_alloc_arg	= (__force void *)GFP_ATOMIC,
 	};
 
 	/*
-- 
2.43.0
Re: [PATCH] arm64: hibernate: Fix warning for cast from restricted gfp_t
Posted by Will Deacon 2 months, 2 weeks ago
On Wed, 11 Sep 2024 07:25:05 +0800, Min-Hua Chen wrote:
> This patch fixes the following warning by adding __force
> to the cast:
> arch/arm64/kernel/hibernate.c:410:44: sparse: warning: cast from restricted gfp_t
> 
> No functional change intended.
> 
> 
> [...]

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64: hibernate: Fix warning for cast from restricted gfp_t
      https://git.kernel.org/arm64/c/ecdd16df4564

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev