linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qian Cai <cai@lca.pw>
To: YueHaibing <yuehaibing@huawei.com>,
	akpm@linux-foundation.org,  kirill.shutemov@linux.intel.com,
	mhocko@suse.com, vbabka@suse.cz,  yang.shi@linux.alibaba.com,
	jannh@google.com, walken@google.com
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm/mmap.c: silence variable 'new_start' set but not used
Date: Wed, 24 Jul 2019 10:11:05 -0400	[thread overview]
Message-ID: <1563977465.11067.9.camel@lca.pw> (raw)
In-Reply-To: <20190724140739.59532-1-yuehaibing@huawei.com>

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.

> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.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))


  reply	other threads:[~2019-07-24 14:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 14:07 YueHaibing
2019-07-24 14:11 ` Qian Cai [this message]
2019-07-24 14:17   ` Michal Hocko
2019-07-24 14:34 ` Kirill A. Shutemov
2019-07-25  9:30   ` Yuehaibing

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=1563977465.11067.9.camel@lca.pw \
    --to=cai@lca.pw \
    --cc=akpm@linux-foundation.org \
    --cc=jannh@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=vbabka@suse.cz \
    --cc=walken@google.com \
    --cc=yang.shi@linux.alibaba.com \
    --cc=yuehaibing@huawei.com \
    /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