All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/test_hmm: Remove set but unused page variable
@ 2021-07-06  2:56 Alistair Popple
  2021-07-06 16:00 ` Souptick Joarder
  0 siblings, 1 reply; 2+ messages in thread
From: Alistair Popple @ 2021-07-06  2:56 UTC (permalink / raw)
  To: akpm, linux-mm
  Cc: rcampbell, Alistair Popple, Hulk Robot, kernel test robot,
	Yang Yingliang

The HMM selftests use atomic_check_access() to check atomic access to a
page has been revoked. It doesn't matter if the page mapping has been
removed from the mirrored page tables as that also implies atomic access
has been revoked. Therefore remove the unused page variable to fix this
compiler warning:

  lib/test_hmm.c:631:16: warning: variable ‘page’ set but not used [-Wunused-but-set-variable]

Fixes: b659baea7546 ("mm: selftests for exclusive device memory")
Reported-by: Hulk Robot <hulkci@huawei.com>
Reported-by: kernel test robot <oliver.sang@intel.com>
Reported-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Alistair Popple <apopple@nvidia.com>
---
 lib/test_hmm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/test_hmm.c b/lib/test_hmm.c
index 8c55c4723692..c259842f6d44 100644
--- a/lib/test_hmm.c
+++ b/lib/test_hmm.c
@@ -628,10 +628,8 @@ static int dmirror_check_atomic(struct dmirror *dmirror, unsigned long start,
 
 	for (pfn = start >> PAGE_SHIFT; pfn < (end >> PAGE_SHIFT); pfn++) {
 		void *entry;
-		struct page *page;
 
 		entry = xa_load(&dmirror->pt, pfn);
-		page = xa_untag_pointer(entry);
 		if (xa_pointer_tag(entry) == DPT_XA_TAG_ATOMIC)
 			return -EPERM;
 	}
-- 
2.20.1



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

* Re: [PATCH] lib/test_hmm: Remove set but unused page variable
  2021-07-06  2:56 [PATCH] lib/test_hmm: Remove set but unused page variable Alistair Popple
@ 2021-07-06 16:00 ` Souptick Joarder
  0 siblings, 0 replies; 2+ messages in thread
From: Souptick Joarder @ 2021-07-06 16:00 UTC (permalink / raw)
  To: Alistair Popple
  Cc: Andrew Morton, Linux-MM, Ralph Campbell, Hulk Robot,
	kernel test robot, Yang Yingliang

On Tue, Jul 6, 2021 at 8:26 AM Alistair Popple <apopple@nvidia.com> wrote:
>
> The HMM selftests use atomic_check_access() to check atomic access to a
> page has been revoked. It doesn't matter if the page mapping has been
> removed from the mirrored page tables as that also implies atomic access
> has been revoked. Therefore remove the unused page variable to fix this
> compiler warning:
>
>   lib/test_hmm.c:631:16: warning: variable ‘page’ set but not used [-Wunused-but-set-variable]
>
> Fixes: b659baea7546 ("mm: selftests for exclusive device memory")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Reported-by: Yang Yingliang <yangyingliang@huawei.com>
> Signed-off-by: Alistair Popple <apopple@nvidia.com>

Acked-by: Souptick Joarder <jrdr.linux@gmail.com>

> ---
>  lib/test_hmm.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/lib/test_hmm.c b/lib/test_hmm.c
> index 8c55c4723692..c259842f6d44 100644
> --- a/lib/test_hmm.c
> +++ b/lib/test_hmm.c
> @@ -628,10 +628,8 @@ static int dmirror_check_atomic(struct dmirror *dmirror, unsigned long start,
>
>         for (pfn = start >> PAGE_SHIFT; pfn < (end >> PAGE_SHIFT); pfn++) {
>                 void *entry;
> -               struct page *page;
>
>                 entry = xa_load(&dmirror->pt, pfn);
> -               page = xa_untag_pointer(entry);
>                 if (xa_pointer_tag(entry) == DPT_XA_TAG_ATOMIC)
>                         return -EPERM;
>         }
> --
> 2.20.1
>
>


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

end of thread, other threads:[~2021-07-06 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06  2:56 [PATCH] lib/test_hmm: Remove set but unused page variable Alistair Popple
2021-07-06 16:00 ` Souptick Joarder

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.