Skip to contentSkip to conversation

mm,fs,dax: mark dax_iomap_pmd_fault as const

PATCH Applied Arnd Bergmann 2 participants 2 messages Feb 27, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm,fs,dax: mark dax_iomap_pmd_fault as const

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")
---
 fs/dax.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/dax.c +1 -1
index d5712f42a2e6..85479428518f 100644
@@ -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;
 }
Signature · 1 line
2.9.0
#1 lore raw
Quoted 11 lines · Arnd Bergmann

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")

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

Quoted 18 lines
---
 fs/dax.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/dax.c +1 -1
index d5712f42a2e6..85479428518f 100644
@@ -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;
 }