All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/huge_memory.c: Remove unused variable unmap_success
@ 2021-05-18 20:09 Souptick Joarder
  2021-05-18 20:19   ` Yang Shi
  2021-05-25  8:02 ` David Hildenbrand
  0 siblings, 2 replies; 6+ messages in thread
From: Souptick Joarder @ 2021-05-18 20:09 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Souptick Joarder, kernel test robot

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/huge_memory.c: Remove unused variable unmap_success
  2021-05-18 20:09 [PATCH] mm/huge_memory.c: Remove unused variable unmap_success Souptick Joarder
@ 2021-05-18 20:19   ` Yang Shi
  2021-05-25  8:02 ` David Hildenbrand
  1 sibling, 0 replies; 6+ messages in thread
From: Yang Shi @ 2021-05-18 20:19 UTC (permalink / raw)
  To: Souptick Joarder
  Cc: Andrew Morton, Linux MM, Linux Kernel Mailing List, kernel test robot

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/huge_memory.c: Remove unused variable unmap_success
@ 2021-05-18 20:19   ` Yang Shi
  0 siblings, 0 replies; 6+ messages in thread
From: Yang Shi @ 2021-05-18 20:19 UTC (permalink / raw)
  To: Souptick Joarder
  Cc: Andrew Morton, Linux MM, Linux Kernel Mailing List, kernel test robot

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/huge_memory.c: Remove unused variable unmap_success
  2021-05-18 20:19   ` Yang Shi
@ 2021-05-18 20:34     ` Yang Shi
  -1 siblings, 0 replies; 6+ messages in thread
From: Yang Shi @ 2021-05-18 20:34 UTC (permalink / raw)
  To: Souptick Joarder
  Cc: Andrew Morton, Linux MM, Linux Kernel Mailing List, kernel test robot

On Tue, May 18, 2021 at 1:19 PM Yang Shi <shy828301@gmail.com> wrote:
>
> 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.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/huge_memory.c: Remove unused variable unmap_success
@ 2021-05-18 20:34     ` Yang Shi
  0 siblings, 0 replies; 6+ messages in thread
From: Yang Shi @ 2021-05-18 20:34 UTC (permalink / raw)
  To: Souptick Joarder
  Cc: Andrew Morton, Linux MM, Linux Kernel Mailing List, kernel test robot

On Tue, May 18, 2021 at 1:19 PM Yang Shi <shy828301@gmail.com> wrote:
>
> 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.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/huge_memory.c: Remove unused variable unmap_success
  2021-05-18 20:09 [PATCH] mm/huge_memory.c: Remove unused variable unmap_success Souptick Joarder
  2021-05-18 20:19   ` Yang Shi
@ 2021-05-25  8:02 ` David Hildenbrand
  1 sibling, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2021-05-25  8:02 UTC (permalink / raw)
  To: Souptick Joarder, akpm; +Cc: linux-mm, linux-kernel, kernel test robot

On 18.05.21 22:09, Souptick Joarder 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>
> ---
>   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)
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-25  8:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 20:09 [PATCH] mm/huge_memory.c: Remove unused variable unmap_success Souptick Joarder
2021-05-18 20:19 ` Yang Shi
2021-05-18 20:19   ` Yang Shi
2021-05-18 20:34   ` Yang Shi
2021-05-18 20:34     ` Yang Shi
2021-05-25  8:02 ` David Hildenbrand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.