All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Glisse <jglisse@redhat.com>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: akpm@linux-foundation.org, willy@infradead.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hmm: Convert to use vm_fault_t
Date: Thu, 10 Jan 2019 10:03:43 -0500	[thread overview]
Message-ID: <20190110150343.GA4394@redhat.com> (raw)
In-Reply-To: <20190110145900.GA1317@jordon-HP-15-Notebook-PC>

On Thu, Jan 10, 2019 at 08:29:00PM +0530, Souptick Joarder wrote:
> convert to use vm_fault_t type as return type for
> fault handler.
> 
> kbuild reported warning during testing of
> *mm-create-the-new-vm_fault_t-type.patch* available in below link -
> https://patchwork.kernel.org/patch/10752741/
> 
> [auto build test WARNING on linus/master]
> [also build test WARNING on v5.0-rc1 next-20190109]
> [if your patch is applied to the wrong git tree, please drop us a note
> to help improve the system]
> 
> kernel/memremap.c:46:34: warning: incorrect type in return expression
>                          (different base types)
> kernel/memremap.c:46:34: expected restricted vm_fault_t
> kernel/memremap.c:46:34: got int
> 
> This patch has fixed the warnings and also hmm_devmem_fault() is
> converted to return vm_fault_t to avoid further warnings.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>

Reviewed-by: Jérôme Glisse <jglisse@redhat.com>

> ---
>  include/linux/hmm.h | 4 ++--
>  mm/hmm.c            | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/hmm.h b/include/linux/hmm.h
> index 66f9ebb..ad50b7b 100644
> --- a/include/linux/hmm.h
> +++ b/include/linux/hmm.h
> @@ -468,7 +468,7 @@ struct hmm_devmem_ops {
>  	 * Note that mmap semaphore is held in read mode at least when this
>  	 * callback occurs, hence the vma is valid upon callback entry.
>  	 */
> -	int (*fault)(struct hmm_devmem *devmem,
> +	vm_fault_t (*fault)(struct hmm_devmem *devmem,
>  		     struct vm_area_struct *vma,
>  		     unsigned long addr,
>  		     const struct page *page,
> @@ -511,7 +511,7 @@ struct hmm_devmem_ops {
>   * chunk, as an optimization. It must, however, prioritize the faulting address
>   * over all the others.
>   */
> -typedef int (*dev_page_fault_t)(struct vm_area_struct *vma,
> +typedef vm_fault_t (*dev_page_fault_t)(struct vm_area_struct *vma,
>  				unsigned long addr,
>  				const struct page *page,
>  				unsigned int flags,
> diff --git a/mm/hmm.c b/mm/hmm.c
> index a04e4b8..fe1cd87 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -990,7 +990,7 @@ static void hmm_devmem_ref_kill(struct percpu_ref *ref)
>  	percpu_ref_kill(ref);
>  }
>  
> -static int hmm_devmem_fault(struct vm_area_struct *vma,
> +static vm_fault_t hmm_devmem_fault(struct vm_area_struct *vma,
>  			    unsigned long addr,
>  			    const struct page *page,
>  			    unsigned int flags,
> -- 
> 1.9.1
> 

WARNING: multiple messages have this Message-ID
From: Jerome Glisse <jglisse@redhat.com>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: akpm@linux-foundation.org, willy@infradead.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hmm: Convert to use vm_fault_t
Date: Thu, 10 Jan 2019 10:03:43 -0500	[thread overview]
Message-ID: <20190110150343.GA4394@redhat.com> (raw)
In-Reply-To: <20190110145900.GA1317@jordon-HP-15-Notebook-PC>

On Thu, Jan 10, 2019 at 08:29:00PM +0530, Souptick Joarder wrote:
> convert to use vm_fault_t type as return type for
> fault handler.
> 
> kbuild reported warning during testing of
> *mm-create-the-new-vm_fault_t-type.patch* available in below link -
> https://patchwork.kernel.org/patch/10752741/
> 
> [auto build test WARNING on linus/master]
> [also build test WARNING on v5.0-rc1 next-20190109]
> [if your patch is applied to the wrong git tree, please drop us a note
> to help improve the system]
> 
> kernel/memremap.c:46:34: warning: incorrect type in return expression
>                          (different base types)
> kernel/memremap.c:46:34: expected restricted vm_fault_t
> kernel/memremap.c:46:34: got int
> 
> This patch has fixed the warnings and also hmm_devmem_fault() is
> converted to return vm_fault_t to avoid further warnings.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>

Reviewed-by: J�r�me Glisse <jglisse@redhat.com>

> ---
>  include/linux/hmm.h | 4 ++--
>  mm/hmm.c            | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/hmm.h b/include/linux/hmm.h
> index 66f9ebb..ad50b7b 100644
> --- a/include/linux/hmm.h
> +++ b/include/linux/hmm.h
> @@ -468,7 +468,7 @@ struct hmm_devmem_ops {
>  	 * Note that mmap semaphore is held in read mode at least when this
>  	 * callback occurs, hence the vma is valid upon callback entry.
>  	 */
> -	int (*fault)(struct hmm_devmem *devmem,
> +	vm_fault_t (*fault)(struct hmm_devmem *devmem,
>  		     struct vm_area_struct *vma,
>  		     unsigned long addr,
>  		     const struct page *page,
> @@ -511,7 +511,7 @@ struct hmm_devmem_ops {
>   * chunk, as an optimization. It must, however, prioritize the faulting address
>   * over all the others.
>   */
> -typedef int (*dev_page_fault_t)(struct vm_area_struct *vma,
> +typedef vm_fault_t (*dev_page_fault_t)(struct vm_area_struct *vma,
>  				unsigned long addr,
>  				const struct page *page,
>  				unsigned int flags,
> diff --git a/mm/hmm.c b/mm/hmm.c
> index a04e4b8..fe1cd87 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -990,7 +990,7 @@ static void hmm_devmem_ref_kill(struct percpu_ref *ref)
>  	percpu_ref_kill(ref);
>  }
>  
> -static int hmm_devmem_fault(struct vm_area_struct *vma,
> +static vm_fault_t hmm_devmem_fault(struct vm_area_struct *vma,
>  			    unsigned long addr,
>  			    const struct page *page,
>  			    unsigned int flags,
> -- 
> 1.9.1
> 

  reply	other threads:[~2019-01-10 15:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 14:59 Souptick Joarder
2019-01-10 15:03 ` Jerome Glisse [this message]
2019-01-10 15:03   ` Jerome Glisse

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=20190110150343.GA4394@redhat.com \
    --to=jglisse@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    --subject='Re: [PATCH] mm/hmm: Convert to use vm_fault_t' \
    /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

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.