lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHbLzkqZZpQ+JUA10QaLDZUqiGr6XkSc+Dhpatd6JPhzhdE7Bg@mail.gmail.com>
Date:   Tue, 18 May 2021 13:34:55 -0700
From:   Yang Shi <shy828301@...il.com>
To:     Souptick Joarder <jrdr.linux@...il.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Linux MM <linux-mm@...ck.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] mm/huge_memory.c: Remove unused variable unmap_success

On Tue, May 18, 2021 at 1:19 PM Yang Shi <shy828301@...il.com> wrote:
>
> On Tue, May 18, 2021 at 1:09 PM Souptick Joarder <jrdr.linux@...il.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@...el.com>
> > Signed-off-by: Souptick Joarder <jrdr.linux@...il.com>
>
> Thanks for catching this. Reviewed-by: Yang Shi <shy828301@...il.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.

I just found out my build has "-Wno-unused-but-set-variable". This
explains why I didn't catch it.

> > ---
> >  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
> >
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ