lib/test_hmm: check page after calling xa_untag_pointer()
PATCH 1/1 lib/test_hmm: check page after calling xa_untag_pointer()
Check page after calling xa_untag_pointer() to fix compile warning:
lib/test_hmm.c:631:16: warning: variable ‘page’ set but not used [-Wunused-but-set-variable]
631 | struct page *page;
| ^~~~
Fixes 8b2a105c3794 ("mm: selftests for exclusive device memory")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Yang Yingliang <[email protected]>
--- lib/test_hmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_hmm.c +1 -1
@@ -632,7 +632,7 @@ static int dmirror_check_atomic(struct dmirror *dmirror, unsigned long start, entry =xa_load (&dmirror->pt, pfn); page =xa_untag_pointer (entry); -if (xa_pointer_tag (entry) ==DPT_XA_TAG_ATOMIC ) +if (!page ||xa_pointer_tag (entry) ==DPT_XA_TAG_ATOMIC )return -EPERM ; }
Signature · 1 line
2.25.1
Quoted 8 lines · Yang Yingliang
Check page after calling
xa_untag_pointer()to fix compile warning:
lib/test_hmm.c:631:16: warning: variable ‘page’ set but not used [-Wunused-but-set-variable]
631 | struct page *page;
| ^~~~Fixes 8b2a105c3794 ("mm: selftests for exclusive device memory")Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>
Reviewed-by Ralph Campbell <[email protected]>