Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Link: http://lkml.kernel.org/r/20170227203349.3318733-1-arnd@arndb.de
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Arnd Bergmann and committed by
Linus Torvalds
01cddfe9 e5d56efc

+2 -1
+2 -1
fs/dax.c
··· 1436 1436 return result; 1437 1437 } 1438 1438 #else 1439 - static int dax_iomap_pmd_fault(struct vm_fault *vmf, struct iomap_ops *ops) 1439 + static int dax_iomap_pmd_fault(struct vm_fault *vmf, 1440 + const struct iomap_ops *ops) 1440 1441 { 1441 1442 return VM_FAULT_FALLBACK; 1442 1443 }