From: Pavel Tatashin <pasha.tatashin@soleen.com>
To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org,
ebiederm@xmission.com, linux-kernel@vger.kernel.org,
corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org,
linux-arm-kernel@lists.infradead.org, maz@kernel.org,
james.morse@arm.com, vladimir.murzin@arm.com,
matthias.bgg@gmail.com, mark.rutland@arm.com,
steve.capper@arm.com, rfontana@redhat.com, selindag@gmail.com,
tyhicks@linux.microsoft.com
Subject: [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting
Date: Mon, 1 Feb 2021 10:03:06 -0500 [thread overview]
Message-ID: <20210201150306.54099-2-pasha.tatashin@soleen.com> (raw)
In-Reply-To: <20210201150306.54099-1-pasha.tatashin@soleen.com>
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
next prev parent reply other threads:[~2021-02-01 15:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-01 15:03 [PATCH 0/1] arm64/hibernate: sparse warnings fix Pavel Tatashin
2021-02-01 15:03 ` Pavel Tatashin [this message]
2021-02-02 8:42 ` [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting Christoph Hellwig
2021-02-02 15:05 ` Pavel Tatashin
2021-02-01 17:13 ` [PATCH 0/1] arm64/hibernate: sparse warnings fix Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210201150306.54099-2-pasha.tatashin@soleen.com \
--to=pasha.tatashin@soleen.com \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=ebiederm@xmission.com \
--cc=james.morse@arm.com \
--cc=jmorris@namei.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=maz@kernel.org \
--cc=rfontana@redhat.com \
--cc=sashal@kernel.org \
--cc=selindag@gmail.com \
--cc=steve.capper@arm.com \
--cc=tyhicks@linux.microsoft.com \
--cc=vladimir.murzin@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®