arm64: hibernate: add __force attribute to gfp_t casting

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: 50f53fb721 ("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>
Link: https://lore.kernel.org/r/20210201150306.54099-2-pasha.tatashin@soleen.com
Signed-off-by: Will Deacon <will@kernel.org>
This commit is contained in:
Pavel Tatashin 2021-02-01 10:03:06 -05:00 committed by Will Deacon
parent a360190e8a
commit d1bbc35fca
1 changed files with 2 additions and 2 deletions

View File

@ -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);