All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Tatashin <pasha.tatashin@soleen.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: James Morris <jmorris@namei.org>, Sasha Levin <sashal@kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
	Vladimir Murzin <vladimir.murzin@arm.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>,
	steve.capper@arm.com, rfontana@redhat.com,
	Selin Dag <selindag@gmail.com>,
	Tyler Hicks <tyhicks@linux.microsoft.com>
Subject: Re: [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting
Date: Tue, 2 Feb 2021 10:05:03 -0500	[thread overview]
Message-ID: <CA+CK2bDvUof-h-Y5QVDTQyBKavkYi9pVOtUmoKn64MReUdMwoQ@mail.gmail.com> (raw)
In-Reply-To: <20210202084243.GA3558964@infradead.org>

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

WARNING: multiple messages have this Message-ID (diff)
From: Pavel Tatashin <pasha.tatashin@soleen.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Sasha Levin <sashal@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Vladimir Murzin <vladimir.murzin@arm.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Selin Dag <selindag@gmail.com>,
	steve.capper@arm.com, LKML <linux-kernel@vger.kernel.org>,
	James Morris <jmorris@namei.org>,
	rfontana@redhat.com, Tyler Hicks <tyhicks@linux.microsoft.com>,
	James Morse <james.morse@arm.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Marc Zyngier <maz@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Will Deacon <will@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/1] arm64: hibernate: add __force attribute to gfp_t casting
Date: Tue, 2 Feb 2021 10:05:03 -0500	[thread overview]
Message-ID: <CA+CK2bDvUof-h-Y5QVDTQyBKavkYi9pVOtUmoKn64MReUdMwoQ@mail.gmail.com> (raw)
In-Reply-To: <20210202084243.GA3558964@infradead.org>

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

  reply	other threads:[~2021-02-02 15:11 UTC|newest]

Thread overview: 10+ 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
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 [this message]
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

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=CA+CK2bDvUof-h-Y5QVDTQyBKavkYi9pVOtUmoKn64MReUdMwoQ@mail.gmail.com \
    --to=pasha.tatashin@soleen.com \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=ebiederm@xmission.com \
    --cc=hch@infradead.org \
    --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 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.