linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: huge_pte_offset() returns pte_t *, not integer
@ 2019-10-16  9:51 Ben Dooks (Codethink)
  2019-10-28 21:55 ` Mike Kravetz
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Dooks (Codethink) @ 2019-10-16  9:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ben Dooks (Codethink), Mike Kravetz, linux-mm, linux-kernel

The huge_pte_offset() returns a pte_t *, not an integer
so when huge-tlb is off, the replacement inline macro
should return a pte_t * too.

This fixes the following sparse warning:

mm/page_vma_mapped.c:156:29: warning: Using plain integer as NULL pointer

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
---
 include/linux/hugetlb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 53fc34f930d0..e42c76aa1577 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -185,7 +185,7 @@ static inline void hugetlb_show_meminfo(void)
 #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
 #define hugetlb_mcopy_atomic_pte(dst_mm, dst_pte, dst_vma, dst_addr, \
 				src_addr, pagep)	({ BUG(); 0; })
-#define huge_pte_offset(mm, address, sz)	0
+#define huge_pte_offset(mm, address, sz)	(pte_t *)NULL
 
 static inline bool isolate_huge_page(struct page *page, struct list_head *list)
 {
-- 
2.23.0



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

end of thread, other threads:[~2019-10-29 23:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16  9:51 [PATCH] mm: huge_pte_offset() returns pte_t *, not integer Ben Dooks (Codethink)
2019-10-28 21:55 ` Mike Kravetz
2019-10-29 12:35   ` Jason Gunthorpe
2019-10-29 23:28     ` Mike Kravetz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).