[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZYq9klTts4yg8RhG@memverge.com>
Date: Tue, 26 Dec 2023 06:48:34 -0500
From: Gregory Price <gregory.price@...verge.com>
To: "Huang, Ying" <ying.huang@...el.com>
Cc: Gregory Price <gourry.memverge@...il.com>, linux-mm@...ck.org,
linux-doc@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
x86@...nel.org, akpm@...ux-foundation.org, arnd@...db.de,
tglx@...utronix.de, luto@...nel.org, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com, mhocko@...nel.org,
tj@...nel.org, corbet@....net, rakie.kim@...com,
hyeongtak.ji@...com, honggyu.kim@...com, vtavarespetr@...ron.com,
peterz@...radead.org, jgroves@...ron.com, ravis.opensrc@...ron.com,
sthanneeru@...ron.com, emirakhur@...ron.com, Hasan.Maruf@....com,
seungjun.ha@...sung.com
Subject: Re: [PATCH v5 03/11] mm/mempolicy: refactor sanitize_mpol_flags for
reuse
On Tue, Dec 26, 2023 at 02:05:35AM -0500, Gregory Price wrote:
> On Wed, Dec 27, 2023 at 04:39:29PM +0800, Huang, Ying wrote:
> > Gregory Price <gourry.memverge@...il.com> writes:
> >
> > > + unsigned short mode = (*mode_arg & ~MPOL_MODE_FLAGS);
> > > +
> > > + *flags = *mode_arg & MPOL_MODE_FLAGS;
> > > + *mode_arg = mode;
> >
> > It appears that it's unnecessary to introduce a local variable to split
> > mode/flags. Just reuse the original code?
> >
Revisiting during fixes: Note the change from int to short.
I chose to make this explicit because validate_mpol_flags takes a short.
I'm fairly sure changing it back throws a truncation warning.
~Gregroy
Powered by blists - more mailing lists