[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190724141710.GD5584@dhcp22.suse.cz>
Date: Wed, 24 Jul 2019 16:17:10 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Qian Cai <cai@....pw>
Cc: YueHaibing <yuehaibing@...wei.com>, akpm@...ux-foundation.org,
kirill.shutemov@...ux.intel.com, vbabka@...e.cz,
yang.shi@...ux.alibaba.com, jannh@...gle.com, walken@...gle.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH] mm/mmap.c: silence variable 'new_start' set but not used
On Wed 24-07-19 10:11:05, Qian Cai wrote:
> On Wed, 2019-07-24 at 22:07 +0800, YueHaibing wrote:
> > 'new_start' is used in is_hugepage_only_range(),
> > which do nothing in some arch. gcc will warning:
> >
> > mm/mmap.c: In function acct_stack_growth:
> > mm/mmap.c:2311:16: warning: variable new_start set but not used [-Wunused-but-
> > set-variable]
>
> Nope. Convert them to inline instead.
Agreed. Obfuscating the code is not really something we want.
> > Reported-by: Hulk Robot <hulkci@...wei.com>
> > Signed-off-by: YueHaibing <yuehaibing@...wei.com>
> > ---
> > mm/mmap.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mm/mmap.c b/mm/mmap.c
> > index e2dbed3..56c2a92 100644
> > --- a/mm/mmap.c
> > +++ b/mm/mmap.c
> > @@ -2308,7 +2308,7 @@ static int acct_stack_growth(struct vm_area_struct *vma,
> > unsigned long size, unsigned long grow)
> > {
> > struct mm_struct *mm = vma->vm_mm;
> > - unsigned long new_start;
> > + unsigned long __maybe_unused new_start;
> >
> > /* address space limit tests */
> > if (!may_expand_vm(mm, vma->vm_flags, grow))
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists