Re: [PATCH] mm: huge_pte_offset() returns pte_t *, not integer

From: Mike Kravetz
Date: Tue Oct 29 2019 - 19:29:05 EST


On 10/29/19 5:35 AM, Jason Gunthorpe wrote:
> On Mon, Oct 28, 2019 at 02:55:13PM -0700, Mike Kravetz wrote:
>
>>> 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
>
> We have recently been converting functions like this to static
> inlines, maybe that is more appropriate for this block of 'functions'
> as well?

Yes. And thanks again Jason for converting some of these in the past!

How about this?