From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org,
akpm@linux-foundation.org
Subject: Re: [PATCH] nfs: Fix unused variable warning.
Date: Mon, 31 Oct 2011 13:43:54 -0400 [thread overview]
Message-ID: <1320083034.4714.24.camel@lade.trondhjem.org> (raw)
In-Reply-To: <CADZ9YHhq91+Td03OjWbX0rwHwb6Y7QhicsuDqqAUSy2O8=05BA@mail.gmail.com>
On Mon, 2011-10-31 at 23:12 +0600, Rakib Mullick wrote:
> On Mon, Oct 31, 2011 at 9:18 PM, Trond Myklebust
> <Trond.Myklebust@netapp.com> wrote:
> > On Fri, 2011-10-28 at 16:36 +0600, Rakib Mullick wrote:
> >
> > This will still cause a warning if you compile without RPC_DEBUG (e.g.
> > if CONFIG_SYSCTL isn't defined).
> >
> I didn't get any warning with CONFIG_SYSCTL=n.
>
> > Since there is only one user, it seems better to just open-code the
> > NFS_SERVER(data->inode) in the dprintk()...
>
> Okay, it seems reasonable. We can simply remove 'server'. Please
> consider the following patch (also attached, might have some white
> space issue).
>
> ---
>
> When CONFIG_NFS=y and CONFIG_NFS_V3_{,V4}=n we get the following warning.
>
> fs/nfs/write.c: In function ‘nfs_writeback_done’:
> fs/nfs/write.c:1246:21: warning: unused variable ‘server’
>
> Remove the variable 'server' to fix the above warning.
>
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
> ---
>
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index 2219c88..a2e4b27 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -1243,7 +1243,6 @@ void nfs_writeback_done(struct rpc_task *task,
> struct nfs_write_data *data)
> {
> struct nfs_writeargs *argp = &data->args;
> struct nfs_writeres *resp = &data->res;
> - struct nfs_server *server = NFS_SERVER(data->inode);
> int status;
>
> dprintk("NFS: %5u nfs_writeback_done (status %d)\n",
> @@ -1277,7 +1276,7 @@ void nfs_writeback_done(struct rpc_task *task,
> struct nfs_write_data *data)
> if (time_before(complain, jiffies)) {
> dprintk("NFS: faulty NFS server %s:"
> " (committed = %d) != (stable = %d)\n",
> - server->nfs_client->cl_hostname,
> + data->inode->nfs_client->cl_hostname,
^^^^^^^^^^^^
NFS_SERVER(data->inode)->nfs_client....
> resp->verf->committed, argp->stable);
> complain = jiffies + 300 * HZ;
> }
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
next prev parent reply other threads:[~2011-10-31 17:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-28 10:36 [PATCH] nfs: Fix unused variable warning Rakib Mullick
2011-10-31 15:18 ` Trond Myklebust
2011-10-31 17:12 ` Rakib Mullick
2011-10-31 17:43 ` Trond Myklebust [this message]
2011-10-31 18:16 ` Rakib Mullick
2011-10-31 18:28 ` Trond Myklebust
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=1320083034.4714.24.camel@lade.trondhjem.org \
--to=trond.myklebust@netapp.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=rakib.mullick@gmail.com \
/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