linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yang Shi <shy828301@gmail.com>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux MM <linux-mm@kvack.org>,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] mm/huge_memory.c: Remove unused variable unmap_success
Date: Tue, 18 May 2021 13:19:29 -0700	[thread overview]
Message-ID: <CAHbLzkpZnqAwDDFYHwd7K7CA-8i1yZEwOVVZsb4GqA9_7XCz_Q@mail.gmail.com> (raw)
In-Reply-To: <20210518200927.69011-1-jrdr.linux@gmail.com>

On Tue, May 18, 2021 at 1:09 PM Souptick Joarder <jrdr.linux@gmail.com> wrote:
>
> Kernel test robot throws below warning ->
>
>    mm/huge_memory.c: In function 'unmap_page':
> >> mm/huge_memory.c:2345:7: warning: variable 'unmap_success' set but not used [-Wunused-but-set-variable]
>     2345 |  bool unmap_success;
>          |       ^~~~~~~~~~~~~
>
> Remove the unused variable unmap_success.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>

Thanks for catching this. Reviewed-by: Yang Shi <shy828301@gmail.com>

Just like https://lore.kernel.org/linux-mm/CAHbLzkonsd9f=48+cxKOJamNb9e8qpvWJCYDGFB_wNTdET2zmQ@mail.gmail.com/T/#t,
not sure why my compiler didn't catch such warning.
> ---
>  mm/huge_memory.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 52ca04b905cf..ff79a12993c9 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -2342,14 +2342,13 @@ static void unmap_page(struct page *page)
>  {
>         enum ttu_flags ttu_flags = TTU_IGNORE_MLOCK |
>                 TTU_RMAP_LOCKED | TTU_SPLIT_HUGE_PMD;
> -       bool unmap_success;
>
>         VM_BUG_ON_PAGE(!PageHead(page), page);
>
>         if (PageAnon(page))
>                 ttu_flags |= TTU_SPLIT_FREEZE;
>
> -       unmap_success = try_to_unmap(page, ttu_flags);
> +       try_to_unmap(page, ttu_flags);
>  }
>
>  static void remap_page(struct page *page, unsigned int nr)
> --
> 2.25.1
>
>


  reply	other threads:[~2021-05-18 20:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 20:09 Souptick Joarder
2021-05-18 20:19 ` Yang Shi [this message]
2021-05-18 20:34   ` Yang Shi
2021-05-25  8:02 ` David Hildenbrand

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=CAHbLzkpZnqAwDDFYHwd7K7CA-8i1yZEwOVVZsb4GqA9_7XCz_Q@mail.gmail.com \
    --to=shy828301@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.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