mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bryan Wu <cooloney@kernel.org>
To: Trond.Myklebust@netapp.com, linux-nfs@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Bryan Wu <cooloney@kernel.org>
Subject: [PATCH] nfs client: kill compile warning on NOMMU machine
Date: Thu,  6 Nov 2008 17:15:21 +0800	[thread overview]
Message-ID: <1225962921-6424-1-git-send-email-cooloney@kernel.org> (raw)

On nommu machine such as Blackfin, when compling NFS we got an warning about
nfs_file_mmap() function defined but not used.

This patch kills this warning.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 fs/nfs/file.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index d319b49..66b8b8e 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -64,11 +64,7 @@ const struct file_operations nfs_file_operations = {
 	.write		= do_sync_write,
 	.aio_read	= nfs_file_read,
 	.aio_write	= nfs_file_write,
-#ifdef CONFIG_MMU
 	.mmap		= nfs_file_mmap,
-#else
-	.mmap		= generic_file_mmap,
-#endif
 	.open		= nfs_file_open,
 	.flush		= nfs_file_flush,
 	.release	= nfs_file_release,
@@ -294,6 +290,7 @@ nfs_file_splice_read(struct file *filp, loff_t *ppos,
 	return res;
 }
 
+#ifdef CONFIG_MMU
 static int
 nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
 {
@@ -312,6 +309,17 @@ nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
 	}
 	return status;
 }
+#else
+static int
+nfs_file_mmap(struct file *file, struct vm_area_struct *vma)
+{
+	/* Kill warning: 'nfs_file_vm_ops' defined but not used */
+	struct vm_operations_struct *vm_ops;
+	vm_ops = &nfs_file_vm_ops;
+
+	return generic_file_mmap(file, vma);
+}
+#endif
 
 /*
  * Flush any dirty pages for this process, and check for write errors.
-- 
1.5.6.3

             reply	other threads:[~2008-11-06  9:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-06  9:15 Bryan Wu [this message]
2009-02-05  9:02 ` Bryan Wu
2009-02-05 13:28   ` Trond Myklebust
2009-02-05 15:37     ` Trond Myklebust
2009-02-05 16:24       ` Bryan Wu

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=1225962921-6424-1-git-send-email-cooloney@kernel.org \
    --to=cooloney@kernel.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®