* [PATCH] dax: constify second argument of dax_iomap_pmd_fault
@ 2017-02-28 0:20 Jérémy Lefaure
2017-02-28 16:38 ` Dave Jiang
0 siblings, 1 reply; 2+ messages in thread
From: Jérémy Lefaure @ 2017-02-28 0:20 UTC (permalink / raw)
To: Dave Jiang, Alexander Viro, Matthew Wilcox, Ross Zwisler
Cc: linux-fsdevel, Jérémy Lefaure
When CONFIG_FS_DAX_PMD is disabled, the second argument of the function
dax_iomap_pmd_fault is not a const pointer. The compiler raises a
warning about that:
fs/dax.c: In function ‘dax_iomap_fault’:
fs/dax.c:1462:35: warning: passing argument 2 of ‘dax_iomap_pmd_fault’
discards ‘const’ qualifier from pointer target type
return dax_iomap_pmd_fault(vmf, ops);
^~~
fs/dax.c:1439:12: note: expected ‘struct iomap_ops *’ but argument is of
type ‘const struct iomap_ops *’
static int dax_iomap_pmd_fault(struct vm_fault *vmf, struct iomap_ops *ops)
^~~~~~~~~~~~~~~~~~~
Constifying the second argument as it is when CONFIG_FX_DAX_PMD is
enabled fixes this warning.
Fixes: a2d581675d48("mm,fs,dax: change ->pmd_fault to ->huge_fault")
Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
---
fs/dax.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/dax.c b/fs/dax.c
index 5ae8b71ebadc..7436c98b92c8 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1436,7 +1436,8 @@ 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.11.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dax: constify second argument of dax_iomap_pmd_fault
2017-02-28 0:20 [PATCH] dax: constify second argument of dax_iomap_pmd_fault Jérémy Lefaure
@ 2017-02-28 16:38 ` Dave Jiang
0 siblings, 0 replies; 2+ messages in thread
From: Dave Jiang @ 2017-02-28 16:38 UTC (permalink / raw)
To: Jérémy Lefaure, Alexander Viro, Matthew Wilcox,
Ross Zwisler
Cc: linux-fsdevel
On 02/27/2017 05:20 PM, Jérémy Lefaure wrote:
> When CONFIG_FS_DAX_PMD is disabled, the second argument of the function
> dax_iomap_pmd_fault is not a const pointer. The compiler raises a
> warning about that:
> fs/dax.c: In function ‘dax_iomap_fault’:
> fs/dax.c:1462:35: warning: passing argument 2 of ‘dax_iomap_pmd_fault’
> discards ‘const’ qualifier from pointer target type
> return dax_iomap_pmd_fault(vmf, ops);
> ^~~
> fs/dax.c:1439:12: note: expected ‘struct iomap_ops *’ but argument is of
> type ‘const struct iomap_ops *’
> static int dax_iomap_pmd_fault(struct vm_fault *vmf, struct iomap_ops *ops)
> ^~~~~~~~~~~~~~~~~~~
>
> Constifying the second argument as it is when CONFIG_FX_DAX_PMD is
> enabled fixes this warning.
>
> Fixes: a2d581675d48("mm,fs,dax: change ->pmd_fault to ->huge_fault")
> Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Thanks. Fix already submitted.
http://marc.info/?l=linux-mm&m=148821429608976&w=2
> ---
> fs/dax.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/dax.c b/fs/dax.c
> index 5ae8b71ebadc..7436c98b92c8 100644
> --- a/fs/dax.c
> +++ b/fs/dax.c
> @@ -1436,7 +1436,8 @@ 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 16:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-28 0:20 [PATCH] dax: constify second argument of dax_iomap_pmd_fault Jérémy Lefaure
2017-02-28 16:38 ` Dave Jiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).