All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs: Fix unused variable build warning when CONFIG_SUNRPC_DEBUG is not set
@ 2015-04-13 22:06 Sergei Zviagintsev
  2015-04-14 19:19 ` Paul Bolle
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Zviagintsev @ 2015-04-13 22:06 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker
  Cc: linux-nfs, linux-kernel, Sergei Zviagintsev

Commit f52cbe4c9838 ("nfs: generic_write_checks() shouldn't be done on
swapout...") caused unused variable build warning in fs/nfs/file.c
when CONFIG_SUNRPC_DEBUG is not set as pos variable is used only in
dprintk() call. Fix it.

Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
Fixes: f52cbe4c9838 ("nfs: generic_write_checks() shouldn't be done on swapout...")
---
 fs/nfs/file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 031ddcb1061d..c40e4363e746 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -674,7 +674,6 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
 	unsigned long written = 0;
 	ssize_t result;
 	size_t count = iov_iter_count(from);
-	loff_t pos = iocb->ki_pos;
 
 	result = nfs_key_timeout_notify(file, inode);
 	if (result)
@@ -688,7 +687,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
 	}
 
 	dprintk("NFS: write(%pD2, %zu@%Ld)\n",
-		file, count, (long long) pos);
+		file, count, (long long) iocb->ki_pos);
 
 	result = -EBUSY;
 	if (IS_SWAPFILE(inode))
-- 
1.8.3.1


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

* Re: [PATCH] nfs: Fix unused variable build warning when CONFIG_SUNRPC_DEBUG is not set
  2015-04-13 22:06 [PATCH] nfs: Fix unused variable build warning when CONFIG_SUNRPC_DEBUG is not set Sergei Zviagintsev
@ 2015-04-14 19:19 ` Paul Bolle
  2015-04-15 21:06   ` Sergei Zviagintsev
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Bolle @ 2015-04-14 19:19 UTC (permalink / raw)
  To: Sergei Zviagintsev
  Cc: Trond Myklebust, Anna Schumaker, linux-nfs, linux-kernel

On Tue, 2015-04-14 at 01:06 +0300, Sergei Zviagintsev wrote:
> Commit f52cbe4c9838 ("nfs: generic_write_checks() shouldn't be done on
> swapout...") caused unused variable build warning in fs/nfs/file.c
> when CONFIG_SUNRPC_DEBUG is not set as pos variable is used only in
> dprintk() call. Fix it.

Would that warning be:
    fs/nfs/file.c: In function ‘nfs_file_write’:
    fs/nfs/file.c:677:9: warning: unused variable ‘pos’ [-Wunused-variable]
      loff_t pos = iocb->ki_pos;
             ^

Please add the warning you fix in the commit explanation. Doing that
might save other people the trouble of doing the work you already did.
Because then basically all they need to do is a web search or a "git log
--grep" for (parts of) that messages. 

> Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
> Fixes: f52cbe4c9838 ("nfs: generic_write_checks() shouldn't be done on swapout...")
> ---
>  fs/nfs/file.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/nfs/file.c b/fs/nfs/file.c
> index 031ddcb1061d..c40e4363e746 100644
> --- a/fs/nfs/file.c
> +++ b/fs/nfs/file.c
> @@ -674,7 +674,6 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
>  	unsigned long written = 0;
>  	ssize_t result;
>  	size_t count = iov_iter_count(from);
> -	loff_t pos = iocb->ki_pos;
>  
>  	result = nfs_key_timeout_notify(file, inode);
>  	if (result)
> @@ -688,7 +687,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
>  	}
>  
>  	dprintk("NFS: write(%pD2, %zu@%Ld)\n",
> -		file, count, (long long) pos);
> +		file, count, (long long) iocb->ki_pos);
>  
>  	result = -EBUSY;
>  	if (IS_SWAPFILE(inode))

Thanks,


Paul Bolle


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

* Re: [PATCH] nfs: Fix unused variable build warning when CONFIG_SUNRPC_DEBUG is not set
  2015-04-14 19:19 ` Paul Bolle
@ 2015-04-15 21:06   ` Sergei Zviagintsev
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Zviagintsev @ 2015-04-15 21:06 UTC (permalink / raw)
  To: Paul Bolle; +Cc: Trond Myklebust, Anna Schumaker, linux-nfs, linux-kernel

Hi Paul,

On Tue, Apr 14, 2015 at 09:19:29PM +0200, Paul Bolle wrote:
> On Tue, 2015-04-14 at 01:06 +0300, Sergei Zviagintsev wrote:
> > Commit f52cbe4c9838 ("nfs: generic_write_checks() shouldn't be done on
> > swapout...") caused unused variable build warning in fs/nfs/file.c
> > when CONFIG_SUNRPC_DEBUG is not set as pos variable is used only in
> > dprintk() call. Fix it.
> 
> Would that warning be:
>     fs/nfs/file.c: In function ‘nfs_file_write’:
>     fs/nfs/file.c:677:9: warning: unused variable ‘pos’ [-Wunused-variable]
>       loff_t pos = iocb->ki_pos;
>              ^
> 
> Please add the warning you fix in the commit explanation. Doing that
> might save other people the trouble of doing the work you already did.
> Because then basically all they need to do is a web search or a "git log
> --grep" for (parts of) that messages. 

Thank you for advice, I missed that. However I see that this warning is
fixed already in Al Viro's vfs repo, so this patch is irrelevant.

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

end of thread, other threads:[~2015-04-15 21:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-13 22:06 [PATCH] nfs: Fix unused variable build warning when CONFIG_SUNRPC_DEBUG is not set Sergei Zviagintsev
2015-04-14 19:19 ` Paul Bolle
2015-04-15 21:06   ` Sergei Zviagintsev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.