From: Huaisheng HS1 Ye <yehs1@lenovo.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"vbabka@suse.cz" <vbabka@suse.cz>,
"mgorman@techsingularity.net" <mgorman@techsingularity.net>,
"alexander.levin@verizon.com" <alexander.levin@verizon.com>,
"colyli@suse.de" <colyli@suse.de>,
NingTing Cheng <chengnt@lenovo.com>
Subject: RE: [PATCH] include/linux/gfp.h: use unsigned int in gfp_zone
Date: Thu, 3 May 2018 14:05:28 +0000 [thread overview]
Message-ID: <HK2PR03MB16841DAECCD847FDEB812D6A92870@HK2PR03MB1684.apcprd03.prod.outlook.com> (raw)
In-Reply-To: <20180503074327.GA4535@dhcp22.suse.cz>
> On Thu 03-05-18 11:44:58, Huaisheng Ye wrote:
> > Suggest using unsigned int instead of int for bit within gfp_zone.
> >
> > The value of bit comes from flags, which's type is gfp_t. And it
> > indicates the number of bits in the right shift for GFP_ZONE_TABLE.
> >
> > Signed-off-by: Huaisheng Ye <yehs1@lenovo.com>
>
> The patch looks OK but it misses the most important piece of
> information. Why this is worth changing. Does it lead to a better code?
> Silence a warning or...
>
Yes, thank you and I will rewrite the commit log later.
Sincerely,
Huaisheng, Ye
> > ---
> > include/linux/gfp.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/gfp.h b/include/linux/gfp.h
> > index 1a4582b..21551fc 100644
> > --- a/include/linux/gfp.h
> > +++ b/include/linux/gfp.h
> > @@ -401,7 +401,7 @@ static inline bool gfpflags_allow_blocking(const gfp_t
> gfp_flags)
> > static inline enum zone_type gfp_zone(gfp_t flags)
> > {
> > enum zone_type z;
> > - int bit = (__force int) (flags & GFP_ZONEMASK);
> > + unsigned int bit = (__force unsigned int) (flags & GFP_ZONEMASK);
> >
> > z = (GFP_ZONE_TABLE >> (bit * GFP_ZONES_SHIFT)) &
> > ((1 << GFP_ZONES_SHIFT) - 1);
> > --
> > 1.8.3.1
> >
>
> --
> Michal Hocko
> SUSE Labs
prev parent reply other threads:[~2018-05-03 14:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1525319098-91429-1-git-send-email-yehs1@lenovo.com>
2018-05-03 7:43 ` Michal Hocko
2018-05-03 14:05 ` Huaisheng HS1 Ye [this message]
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=HK2PR03MB16841DAECCD847FDEB812D6A92870@HK2PR03MB1684.apcprd03.prod.outlook.com \
--to=yehs1@lenovo.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.levin@verizon.com \
--cc=chengnt@lenovo.com \
--cc=colyli@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=vbabka@suse.cz \
/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