From: "Jérémy Lefaure" <jeremy.lefaure@lse.epita.fr>
To: Dave Jiang <dave.jiang@intel.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Matthew Wilcox <mawilcox@microsoft.com>,
Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: linux-fsdevel@vger.kernel.org,
"Jérémy Lefaure" <jeremy.lefaure@lse.epita.fr>
Subject: [PATCH] dax: constify second argument of dax_iomap_pmd_fault
Date: Mon, 27 Feb 2017 19:20:23 -0500 [thread overview]
Message-ID: <20170228002023.23239-1-jeremy.lefaure@lse.epita.fr> (raw)
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
next reply other threads:[~2017-02-28 2:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 0:20 Jérémy Lefaure [this message]
2017-02-28 16:38 ` [PATCH] dax: constify second argument of dax_iomap_pmd_fault Dave Jiang
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=20170228002023.23239-1-jeremy.lefaure@lse.epita.fr \
--to=jeremy.lefaure@lse.epita.fr \
--cc=dave.jiang@intel.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mawilcox@microsoft.com \
--cc=ross.zwisler@linux.intel.com \
--cc=viro@zeniv.linux.org.uk \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).