All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm,fs,dax: mark dax_iomap_pmd_fault as const
@ 2017-02-27 20:33 Arnd Bergmann
  2017-02-27 20:38 ` Dave Jiang
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-02-27 20:33 UTC (permalink / raw)
  To: Alexander Viro, Matthew Wilcox, Ross Zwisler
  Cc: Arnd Bergmann, Jan Kara, Andrew Morton, Dave Chinner,
	Vishal Verma, Dave Jiang, linux-fsdevel, linux-kernel

The two alternative implementations of dax_iomap_fault have different
prototypes, and one of them is obviously wrong as seen from this build
warning:

fs/dax.c: In function 'dax_iomap_fault':
fs/dax.c:1462:35: error: passing argument 2 of 'dax_iomap_pmd_fault' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]

This marks the argument 'const' as in all the related functions.

Fixes: a2d581675d48 ("mm,fs,dax: change ->pmd_fault to ->huge_fault")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/dax.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/dax.c b/fs/dax.c
index d5712f42a2e6..85479428518f 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1436,7 +1436,7 @@ static int dax_iomap_pmd_fault(struct vm_fault *vmf,
 	return result;
 }
 #else
-static int dax_iomap_pmd_fault(struct vm_fault *vmf, struct iomap_ops *ops)
+static int dax_iomap_pmd_fault(struct vm_fault *vmf, const struct iomap_ops *ops)
 {
 	return VM_FAULT_FALLBACK;
 }
-- 
2.9.0

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

* Re: [PATCH] mm,fs,dax: mark dax_iomap_pmd_fault as const
  2017-02-27 20:33 [PATCH] mm,fs,dax: mark dax_iomap_pmd_fault as const Arnd Bergmann
@ 2017-02-27 20:38 ` Dave Jiang
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Jiang @ 2017-02-27 20:38 UTC (permalink / raw)
  To: Arnd Bergmann, Alexander Viro, Matthew Wilcox, Ross Zwisler
  Cc: Jan Kara, Andrew Morton, Dave Chinner, Vishal Verma,
	linux-fsdevel, linux-kernel



On 02/27/2017 01:33 PM, Arnd Bergmann wrote:
> The two alternative implementations of dax_iomap_fault have different
> prototypes, and one of them is obviously wrong as seen from this build
> warning:
> 
> fs/dax.c: In function 'dax_iomap_fault':
> fs/dax.c:1462:35: error: passing argument 2 of 'dax_iomap_pmd_fault' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
> 
> This marks the argument 'const' as in all the related functions.
> 
> Fixes: a2d581675d48 ("mm,fs,dax: change ->pmd_fault to ->huge_fault")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks Arnd. I posted the same fix this morning. :)
http://marc.info/?l=linux-mm&m=148821429608976&w=2

> ---
>  fs/dax.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/dax.c b/fs/dax.c
> index d5712f42a2e6..85479428518f 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -1436,7 +1436,7 @@ static int dax_iomap_pmd_fault(struct vm_fault *vmf,
>  	return result;
>  }
>  #else
> -static int dax_iomap_pmd_fault(struct vm_fault *vmf, struct iomap_ops *ops)
> +static int dax_iomap_pmd_fault(struct vm_fault *vmf, const struct iomap_ops *ops)
>  {
>  	return VM_FAULT_FALLBACK;
>  }
> 

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

end of thread, other threads:[~2017-02-28  2:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-27 20:33 [PATCH] mm,fs,dax: mark dax_iomap_pmd_fault as const Arnd Bergmann
2017-02-27 20:38 ` Dave Jiang

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.