linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Mike Kravetz <mike.kravetz@oracle.com>,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Ben Dooks <ben.dooks@codethink.co.uk>,
	 Jason Gunthorpe <jgg@ziepe.ca>,
	kbuild@lists.01.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/2] hugetlbfs: convert macros to static inline, fix sparse warning
Date: Tue, 12 Nov 2019 13:13:07 -0800	[thread overview]
Message-ID: <a7fddda6f3e47b6aeb5d6d6ea9ea28ec019d3d94.camel@perches.com> (raw)
In-Reply-To: <20191112194558.139389-3-mike.kravetz@oracle.com>

On Tue, 2019-11-12 at 11:45 -0800, Mike Kravetz wrote:
> huge_pte_offset() produced a sparse warning due to an improper
> return type when the kernel was built with !CONFIG_HUGETLB_PAGE.
> Fix the bad type and also convert all the macros in this block
> to static inline wrappers.  Two existing wrappers in this block
> had lines in excess of 80 columns so clean those up as well.
> 
> No functional change.
> 
> Reported-by: Ben Dooks <ben.dooks@codethink.co.uk>
> Suggested-by: Jason Gunthorpe <jgg@ziepe.ca>
> Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
> ---
>  include/linux/hugetlb.h | 137 +++++++++++++++++++++++++++++++++-------
>  1 file changed, 115 insertions(+), 22 deletions(-)
> 
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index 53fc34f930d0..ef412fe0be3d 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -164,38 +164,130 @@ static inline void adjust_range_if_pmd_sharing_possible(
>  {
>  }
>  
> -#define follow_hugetlb_page(m,v,p,vs,a,b,i,w,n)	({ BUG(); 0; })
> -#define follow_huge_addr(mm, addr, write)	ERR_PTR(-EINVAL)
> -#define copy_hugetlb_page_range(src, dst, vma)	({ BUG(); 0; })
> +static inline long follow_hugetlb_page(struct mm_struct *mm,
> +			struct vm_area_struct *vma, struct page **pages,
> +			struct vm_area_struct **vmas, unsigned long *position,
> +			unsigned long *nr_pages, long i, unsigned int flags,
> +			int *nonblocking)
> +{
> +	BUG();

While this is not different from the original, perhaps this is
also an opportunity to change the BUG()s to WARN()s.

> +static inline int copy_hugetlb_page_range(struct mm_struct *dst,
> +			struct mm_struct *src, struct vm_area_struct *vma)
> +{
> +	BUG();
> +	return 0;
> +}
[]
> +static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
> +				unsigned long addr, unsigned long end,
> +				unsigned long floor, unsigned long ceiling)
> +{
> +	BUG();
> +}
> +
> +static inline int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
> +						pte_t *dst_pte,
> +						struct vm_area_struct *dst_vma,
> +						unsigned long dst_addr,
> +						unsigned long src_addr,
> +						struct page **pagep)
> +{
> +	BUG();
> +	return 0;
> +}




  reply	other threads:[~2019-11-12 21:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 19:45 [PATCH 0/2] " Mike Kravetz
2019-11-12 19:45 ` [PATCH 1/2] powerpc/mm: remove pmd_huge/pud_huge stubs and include hugetlb.h Mike Kravetz
2019-11-12 19:45 ` [PATCH 2/2] hugetlbfs: convert macros to static inline, fix sparse warning Mike Kravetz
2019-11-12 21:13   ` Joe Perches [this message]
2019-11-13  0:11     ` Mike Kravetz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7fddda6f3e47b6aeb5d6d6ea9ea28ec019d3d94.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=ben.dooks@codethink.co.uk \
    --cc=jgg@ziepe.ca \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox