From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from blatinox.fr ([51.254.120.209]:36802 "EHLO vps202351.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbdB1CRJ (ORCPT ); Mon, 27 Feb 2017 21:17:09 -0500 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lefaure?= To: Dave Jiang , Alexander Viro , Matthew Wilcox , Ross Zwisler Cc: linux-fsdevel@vger.kernel.org, =?UTF-8?q?J=C3=A9r=C3=A9my=20Lefaure?= Subject: [PATCH] dax: constify second argument of dax_iomap_pmd_fault Date: Mon, 27 Feb 2017 19:20:23 -0500 Message-Id: <20170228002023.23239-1-jeremy.lefaure@lse.epita.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- 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