linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] NFS: silence Sparse warning about a non-ANSI declaration
@ 2012-05-04 17:40 Dan Carpenter
  2012-05-04 18:14 ` Myklebust, Trond
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-05-04 17:40 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, kernel-janitors

Sparse complains because without the "void", it means that the function
takes a variable number of arguments.

fs/nfs/read.c:38:43: warning: non-ANSI function declaration of function
	'nfs_readhdr_alloc'

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 37c9eb2..f23cf25 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -35,7 +35,7 @@ static const struct nfs_pgio_completion_ops nfs_async_read_completion_ops;
 
 static struct kmem_cache *nfs_rdata_cachep;
 
-struct nfs_read_header *nfs_readhdr_alloc()
+struct nfs_read_header *nfs_readhdr_alloc(void)
 {
 	struct nfs_read_header *rhdr;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] NFS: silence Sparse warning about a non-ANSI declaration
  2012-05-04 17:40 [patch] NFS: silence Sparse warning about a non-ANSI declaration Dan Carpenter
@ 2012-05-04 18:14 ` Myklebust, Trond
  0 siblings, 0 replies; 2+ messages in thread
From: Myklebust, Trond @ 2012-05-04 18:14 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

On Fri, 2012-05-04 at 20:40 +0300, Dan Carpenter wrote:
> Sparse complains because without the "void", it means that the function
> takes a variable number of arguments.
> 
> fs/nfs/read.c:38:43: warning: non-ANSI function declaration of function
> 	'nfs_readhdr_alloc'
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/fs/nfs/read.c b/fs/nfs/read.c
> index 37c9eb2..f23cf25 100644
> --- a/fs/nfs/read.c
> +++ b/fs/nfs/read.c
> @@ -35,7 +35,7 @@ static const struct nfs_pgio_completion_ops nfs_async_read_completion_ops;
>  
>  static struct kmem_cache *nfs_rdata_cachep;
>  
> -struct nfs_read_header *nfs_readhdr_alloc()
> +struct nfs_read_header *nfs_readhdr_alloc(void)
>  {
>  	struct nfs_read_header *rhdr;
>  

Yes. I found that together with a couple of "should this be declared
static?" warnings earlier today.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com


[-- Attachment #2: Type: message/rfc822, Size: 3278 bytes --]

From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: <linux-nfs@vger.kernel.org>
Cc: Fred Isaman <iisaman@netapp.com>, Boaz Harrosh <bharrosh@panasas.com>
Subject: [PATCH 2/2] NFS: Fix sparse warnings
Date: Fri, 4 May 2012 14:09:19 -0400
Message-ID: <1336154959-10705-2-git-send-email-Trond.Myklebust@netapp.com>

Fix the following sparse warnings:

fs/nfs/direct.c:221:6: warning: symbol 'nfs_direct_readpage_release' was
not declared. Should it be static?
fs/nfs/read.c:38:43: warning: non-ANSI function declaration of function
'nfs_readhdr_alloc'
fs/nfs/objlayout/objio_osd.c:214:5: warning: symbol '__alloc_objio_seg'
was not declared. Should it be static?

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Fred Isaman <iisaman@netapp.com>
Cc: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfs/direct.c              |    2 +-
 fs/nfs/objlayout/objio_osd.c |    2 +-
 fs/nfs/read.c                |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index dca9c81..257d009 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -218,7 +218,7 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq)
 	nfs_direct_req_release(dreq);
 }
 
-void nfs_direct_readpage_release(struct nfs_page *req)
+static void nfs_direct_readpage_release(struct nfs_page *req)
 {
 	dprintk("NFS: direct read done (%s/%lld %d@%lld)\n",
 		req->wb_context->dentry->d_inode->i_sb->s_id,
diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index fbf4874..b47277b 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -211,7 +211,7 @@ static void copy_single_comp(struct ore_components *oc, unsigned c,
 	memcpy(ocomp->cred, src_comp->oc_cap.cred, sizeof(ocomp->cred));
 }
 
-int __alloc_objio_seg(unsigned numdevs, gfp_t gfp_flags,
+static int __alloc_objio_seg(unsigned numdevs, gfp_t gfp_flags,
 		       struct objio_segment **pseg)
 {
 /*	This is the in memory structure of the objio_segment
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 37c9eb2..f23cf25 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -35,7 +35,7 @@ static const struct nfs_pgio_completion_ops nfs_async_read_completion_ops;
 
 static struct kmem_cache *nfs_rdata_cachep;
 
-struct nfs_read_header *nfs_readhdr_alloc()
+struct nfs_read_header *nfs_readhdr_alloc(void)
 {
 	struct nfs_read_header *rhdr;
 
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-04 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-04 17:40 [patch] NFS: silence Sparse warning about a non-ANSI declaration Dan Carpenter
2012-05-04 18:14 ` Myklebust, Trond

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).