All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] arm64/hibernate: sparse warnings fix
@ 2021-02-01 15:03 ` Pavel Tatashin
  0 siblings, 0 replies; 10+ messages in thread
From: Pavel Tatashin @ 2021-02-01 15:03 UTC (permalink / raw)
  To: pasha.tatashin, jmorris, sashal, ebiederm, linux-kernel, corbet,
	catalin.marinas, will, linux-arm-kernel, maz, james.morse,
	vladimir.murzin, matthias.bgg, mark.rutland, steve.capper,
	rfontana, selindag, tyhicks

This is against for-next/kexec, fix for sparse warning that was reported by
kernel test robot [1].

[1] https://lore.kernel.org/linux-arm-kernel/202101292143.C6TcKvvX-lkp@intel.com

Pavel Tatashin (1):
  arm64: hibernate: add __force attribute to gfp_t casting

 arch/arm64/kernel/hibernate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.25.1


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

* [PATCH 0/1] arm64/hibernate: sparse warnings fix
@ 2021-02-01 15:03 ` Pavel Tatashin
  0 siblings, 0 replies; 10+ messages in thread
From: Pavel Tatashin @ 2021-02-01 15:03 UTC (permalink / raw)
  To: pasha.tatashin, jmorris, sashal, ebiederm, linux-kernel, corbet,
	catalin.marinas, will, linux-arm-kernel, maz, james.morse,
	vladimir.murzin, matthias.bgg, mark.rutland, steve.capper,
	rfontana, selindag, tyhicks

This is against for-next/kexec, fix for sparse warning that was reported by
kernel test robot [1].

[1] https://lore.kernel.org/linux-arm-kernel/202101292143.C6TcKvvX-lkp@intel.com

Pavel Tatashin (1):
  arm64: hibernate: add __force attribute to gfp_t casting

 arch/arm64/kernel/hibernate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting
  2021-02-01 15:03 ` Pavel Tatashin
@ 2021-02-01 15:03   ` Pavel Tatashin
  -1 siblings, 0 replies; 10+ messages in thread
From: Pavel Tatashin @ 2021-02-01 15:03 UTC (permalink / raw)
  To: pasha.tatashin, jmorris, sashal, ebiederm, linux-kernel, corbet,
	catalin.marinas, will, linux-arm-kernel, maz, james.morse,
	vladimir.murzin, matthias.bgg, mark.rutland, steve.capper,
	rfontana, selindag, tyhicks

Two new warnings are reported by sparse:

"sparse warnings: (new ones prefixed by >>)"
>> arch/arm64/kernel/hibernate.c:181:39: sparse: sparse: cast to
   restricted gfp_t
>> arch/arm64/kernel/hibernate.c:202:44: sparse: sparse: cast from
   restricted gfp_t

gfp_t has __bitwise type attribute and requires __force added to casting
in order to avoid these warnings.

Fixes: 50f53fb72181 ("arm64: trans_pgd: make trans_pgd_map_page generic")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
---
 arch/arm64/kernel/hibernate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/hibernate.c b/arch/arm64/kernel/hibernate.c
index 9df32ba0d574..b1cef371df2b 100644
--- a/arch/arm64/kernel/hibernate.c
+++ b/arch/arm64/kernel/hibernate.c
@@ -178,7 +178,7 @@ EXPORT_SYMBOL(arch_hibernation_header_restore);
 
 static void *hibernate_page_alloc(void *arg)
 {
-	return (void *)get_safe_page((gfp_t)(unsigned long)arg);
+	return (void *)get_safe_page((__force gfp_t)(unsigned long)arg);
 }
 
 /*
@@ -198,7 +198,7 @@ static int create_safe_exec_page(void *src_start, size_t length,
 {
 	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,
 	};
 
 	void *page = (void *)get_safe_page(GFP_ATOMIC);
-- 
2.25.1


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

* [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting
@ 2021-02-01 15:03   ` Pavel Tatashin
  0 siblings, 0 replies; 10+ messages in thread
From: Pavel Tatashin @ 2021-02-01 15:03 UTC (permalink / raw)
  To: pasha.tatashin, jmorris, sashal, ebiederm, linux-kernel, corbet,
	catalin.marinas, will, linux-arm-kernel, maz, james.morse,
	vladimir.murzin, matthias.bgg, mark.rutland, steve.capper,
	rfontana, selindag, tyhicks

Two new warnings are reported by sparse:

"sparse warnings: (new ones prefixed by >>)"
>> arch/arm64/kernel/hibernate.c:181:39: sparse: sparse: cast to
   restricted gfp_t
>> arch/arm64/kernel/hibernate.c:202:44: sparse: sparse: cast from
   restricted gfp_t

gfp_t has __bitwise type attribute and requires __force added to casting
in order to avoid these warnings.

Fixes: 50f53fb72181 ("arm64: trans_pgd: make trans_pgd_map_page generic")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
---
 arch/arm64/kernel/hibernate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/hibernate.c b/arch/arm64/kernel/hibernate.c
index 9df32ba0d574..b1cef371df2b 100644
--- a/arch/arm64/kernel/hibernate.c
+++ b/arch/arm64/kernel/hibernate.c
@@ -178,7 +178,7 @@ EXPORT_SYMBOL(arch_hibernation_header_restore);
 
 static void *hibernate_page_alloc(void *arg)
 {
-	return (void *)get_safe_page((gfp_t)(unsigned long)arg);
+	return (void *)get_safe_page((__force gfp_t)(unsigned long)arg);
 }
 
 /*
@@ -198,7 +198,7 @@ static int create_safe_exec_page(void *src_start, size_t length,
 {
 	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,
 	};
 
 	void *page = (void *)get_safe_page(GFP_ATOMIC);
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/1] arm64/hibernate: sparse warnings fix
  2021-02-01 15:03 ` Pavel Tatashin
@ 2021-02-01 17:13   ` Will Deacon
  -1 siblings, 0 replies; 10+ messages in thread
From: Will Deacon @ 2021-02-01 17:13 UTC (permalink / raw)
  To: vladimir.murzin, matthias.bgg, maz, james.morse, corbet,
	selindag, sashal, mark.rutland, catalin.marinas,
	linux-arm-kernel, ebiederm, linux-kernel, Pavel Tatashin,
	tyhicks, rfontana, jmorris, steve.capper
  Cc: kernel-team, Will Deacon

On Mon, 1 Feb 2021 10:03:05 -0500, Pavel Tatashin wrote:
> This is against for-next/kexec, fix for sparse warning that was reported by
> kernel test robot [1].
> 
> [1] https://lore.kernel.org/linux-arm-kernel/202101292143.C6TcKvvX-lkp@intel.com
> 
> Pavel Tatashin (1):
>   arm64: hibernate: add __force attribute to gfp_t casting
> 
> [...]

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

[1/1] arm64: hibernate: add __force attribute to gfp_t casting
      https://git.kernel.org/arm64/c/d1bbc35fcab2

Cheers,
-- 
Will

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

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

* Re: [PATCH 0/1] arm64/hibernate: sparse warnings fix
@ 2021-02-01 17:13   ` Will Deacon
  0 siblings, 0 replies; 10+ messages in thread
From: Will Deacon @ 2021-02-01 17:13 UTC (permalink / raw)
  To: vladimir.murzin, matthias.bgg, maz, james.morse, corbet,
	selindag, sashal, mark.rutland, catalin.marinas,
	linux-arm-kernel, ebiederm, linux-kernel, Pavel Tatashin,
	tyhicks, rfontana, jmorris, steve.capper
  Cc: Will Deacon, kernel-team

On Mon, 1 Feb 2021 10:03:05 -0500, Pavel Tatashin wrote:
> This is against for-next/kexec, fix for sparse warning that was reported by
> kernel test robot [1].
> 
> [1] https://lore.kernel.org/linux-arm-kernel/202101292143.C6TcKvvX-lkp@intel.com
> 
> Pavel Tatashin (1):
>   arm64: hibernate: add __force attribute to gfp_t casting
> 
> [...]

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

[1/1] arm64: hibernate: add __force attribute to gfp_t casting
      https://git.kernel.org/arm64/c/d1bbc35fcab2

Cheers,
-- 
Will

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting
  2021-02-01 15:03   ` Pavel Tatashin
@ 2021-02-02  8:42     ` Christoph Hellwig
  -1 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2021-02-02  8:42 UTC (permalink / raw)
  To: Pavel Tatashin
  Cc: jmorris, sashal, ebiederm, linux-kernel, corbet, catalin.marinas,
	will, linux-arm-kernel, maz, james.morse, vladimir.murzin,
	matthias.bgg, mark.rutland, steve.capper, rfontana, selindag,
	tyhicks

On Mon, Feb 01, 2021 at 10:03:06AM -0500, Pavel Tatashin wrote:
> Two new warnings are reported by sparse:
> 
> "sparse warnings: (new ones prefixed by >>)"
> >> arch/arm64/kernel/hibernate.c:181:39: sparse: sparse: cast to
>    restricted gfp_t
> >> arch/arm64/kernel/hibernate.c:202:44: sparse: sparse: cast from
>    restricted gfp_t
> 
> gfp_t has __bitwise type attribute and requires __force added to casting
> in order to avoid these warnings.
> 
> Fixes: 50f53fb72181 ("arm64: trans_pgd: make trans_pgd_map_page generic")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>

What about just passing the gfp_t value by reference which would be much
cleaner?

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

* Re: [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting
@ 2021-02-02  8:42     ` Christoph Hellwig
  0 siblings, 0 replies; 10+ messages in thread
From: Christoph Hellwig @ 2021-02-02  8:42 UTC (permalink / raw)
  To: Pavel Tatashin
  Cc: sashal, mark.rutland, vladimir.murzin, corbet, catalin.marinas,
	selindag, steve.capper, linux-kernel, jmorris, rfontana, tyhicks,
	james.morse, ebiederm, maz, matthias.bgg, will, linux-arm-kernel

On Mon, Feb 01, 2021 at 10:03:06AM -0500, Pavel Tatashin wrote:
> Two new warnings are reported by sparse:
> 
> "sparse warnings: (new ones prefixed by >>)"
> >> arch/arm64/kernel/hibernate.c:181:39: sparse: sparse: cast to
>    restricted gfp_t
> >> arch/arm64/kernel/hibernate.c:202:44: sparse: sparse: cast from
>    restricted gfp_t
> 
> gfp_t has __bitwise type attribute and requires __force added to casting
> in order to avoid these warnings.
> 
> Fixes: 50f53fb72181 ("arm64: trans_pgd: make trans_pgd_map_page generic")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>

What about just passing the gfp_t value by reference which would be much
cleaner?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting
  2021-02-02  8:42     ` Christoph Hellwig
@ 2021-02-02 15:05       ` Pavel Tatashin
  -1 siblings, 0 replies; 10+ messages in thread
From: Pavel Tatashin @ 2021-02-02 15:05 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: James Morris, Sasha Levin, Eric W. Biederman, LKML,
	Jonathan Corbet, Catalin Marinas, Will Deacon, Linux ARM,
	Marc Zyngier, James Morse, Vladimir Murzin, Matthias Brugger,
	Mark Rutland, steve.capper, rfontana, Selin Dag, Tyler Hicks

On Tue, Feb 2, 2021 at 3:42 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Mon, Feb 01, 2021 at 10:03:06AM -0500, Pavel Tatashin wrote:
> > Two new warnings are reported by sparse:
> >
> > "sparse warnings: (new ones prefixed by >>)"
> > >> arch/arm64/kernel/hibernate.c:181:39: sparse: sparse: cast to
> >    restricted gfp_t
> > >> arch/arm64/kernel/hibernate.c:202:44: sparse: sparse: cast from
> >    restricted gfp_t
> >
> > gfp_t has __bitwise type attribute and requires __force added to casting
> > in order to avoid these warnings.
> >
> > Fixes: 50f53fb72181 ("arm64: trans_pgd: make trans_pgd_map_page generic")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
>
> What about just passing the gfp_t value by reference which would be much
> cleaner?


Hi Christoph,

Thank you for your suggestions. Passing by reference is OK. I am not
sure it would be much cleaner because for GFP_ATOMIC we would need to
declare another variable on stack before trans_info.

Pasha

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

* Re: [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting
@ 2021-02-02 15:05       ` Pavel Tatashin
  0 siblings, 0 replies; 10+ messages in thread
From: Pavel Tatashin @ 2021-02-02 15:05 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Sasha Levin, Mark Rutland, Vladimir Murzin, Jonathan Corbet,
	Catalin Marinas, Selin Dag, steve.capper, LKML, James Morris,
	rfontana, Tyler Hicks, James Morse, Eric W. Biederman,
	Marc Zyngier, Matthias Brugger, Will Deacon, Linux ARM

On Tue, Feb 2, 2021 at 3:42 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> On Mon, Feb 01, 2021 at 10:03:06AM -0500, Pavel Tatashin wrote:
> > Two new warnings are reported by sparse:
> >
> > "sparse warnings: (new ones prefixed by >>)"
> > >> arch/arm64/kernel/hibernate.c:181:39: sparse: sparse: cast to
> >    restricted gfp_t
> > >> arch/arm64/kernel/hibernate.c:202:44: sparse: sparse: cast from
> >    restricted gfp_t
> >
> > gfp_t has __bitwise type attribute and requires __force added to casting
> > in order to avoid these warnings.
> >
> > Fixes: 50f53fb72181 ("arm64: trans_pgd: make trans_pgd_map_page generic")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
>
> What about just passing the gfp_t value by reference which would be much
> cleaner?


Hi Christoph,

Thank you for your suggestions. Passing by reference is OK. I am not
sure it would be much cleaner because for GFP_ATOMIC we would need to
declare another variable on stack before trans_info.

Pasha

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-02-02 15:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 15:03 [PATCH 0/1] arm64/hibernate: sparse warnings fix Pavel Tatashin
2021-02-01 15:03 ` Pavel Tatashin
2021-02-01 15:03 ` [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting Pavel Tatashin
2021-02-01 15:03   ` Pavel Tatashin
2021-02-02  8:42   ` Christoph Hellwig
2021-02-02  8:42     ` Christoph Hellwig
2021-02-02 15:05     ` Pavel Tatashin
2021-02-02 15:05       ` Pavel Tatashin
2021-02-01 17:13 ` [PATCH 0/1] arm64/hibernate: sparse warnings fix Will Deacon
2021-02-01 17:13   ` Will Deacon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.