Linux-CIFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH -next] CIFS: remove set but not used variables 'cinode' and 'netfid'
@ 2019-10-17  3:53 YueHaibing
  2019-10-19 15:32 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2019-10-17  3:53 UTC (permalink / raw)
  To: Steve French
  Cc: YueHaibing, linux-cifs, samba-technical, linux-kernel,
	kernel-janitors, Hulk Robot

Fixes gcc '-Wunused-but-set-variable' warning:

fs/cifs/file.c: In function 'cifs_flock':
fs/cifs/file.c:1704:8: warning:
 variable 'netfid' set but not used [-Wunused-but-set-variable]

fs/cifs/file.c:1702:24: warning:
 variable 'cinode' set but not used [-Wunused-but-set-variable]

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 fs/cifs/file.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 936e03892e2a..02a81dc6861a 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1699,9 +1699,7 @@ int cifs_flock(struct file *file, int cmd, struct file_lock *fl)
 	bool posix_lck = false;
 	struct cifs_sb_info *cifs_sb;
 	struct cifs_tcon *tcon;
-	struct cifsInodeInfo *cinode;
 	struct cifsFileInfo *cfile;
-	__u16 netfid;
 	__u32 type;
 
 	rc = -EACCES;
@@ -1716,8 +1714,6 @@ int cifs_flock(struct file *file, int cmd, struct file_lock *fl)
 	cifs_read_flock(fl, &type, &lock, &unlock, &wait_flag,
 			tcon->ses->server);
 	cifs_sb = CIFS_FILE_SB(file);
-	netfid = cfile->fid.netfid;
-	cinode = CIFS_I(file_inode(file));
 
 	if (cap_unix(tcon->ses) &&
 	    (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) &&




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

* Re: [PATCH -next] CIFS: remove set but not used variables 'cinode' and 'netfid'
  2019-10-17  3:53 [PATCH -next] CIFS: remove set but not used variables 'cinode' and 'netfid' YueHaibing
@ 2019-10-19 15:32 ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2019-10-19 15:32 UTC (permalink / raw)
  To: YueHaibing
  Cc: Steve French, CIFS, samba-technical, LKML, kernel-janitors, Hulk Robot

tentatively pushed to cifs-2.6.git for-next pending more testing of
the flock patch it modified.

On Fri, Oct 18, 2019 at 1:07 AM YueHaibing <yuehaibing@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> fs/cifs/file.c: In function 'cifs_flock':
> fs/cifs/file.c:1704:8: warning:
>  variable 'netfid' set but not used [-Wunused-but-set-variable]
>
> fs/cifs/file.c:1702:24: warning:
>  variable 'cinode' set but not used [-Wunused-but-set-variable]
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  fs/cifs/file.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index 936e03892e2a..02a81dc6861a 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -1699,9 +1699,7 @@ int cifs_flock(struct file *file, int cmd, struct file_lock *fl)
>         bool posix_lck = false;
>         struct cifs_sb_info *cifs_sb;
>         struct cifs_tcon *tcon;
> -       struct cifsInodeInfo *cinode;
>         struct cifsFileInfo *cfile;
> -       __u16 netfid;
>         __u32 type;
>
>         rc = -EACCES;
> @@ -1716,8 +1714,6 @@ int cifs_flock(struct file *file, int cmd, struct file_lock *fl)
>         cifs_read_flock(fl, &type, &lock, &unlock, &wait_flag,
>                         tcon->ses->server);
>         cifs_sb = CIFS_FILE_SB(file);
> -       netfid = cfile->fid.netfid;
> -       cinode = CIFS_I(file_inode(file));
>
>         if (cap_unix(tcon->ses) &&
>             (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) &&
>
>
>


-- 
Thanks,

Steve

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-17  3:53 [PATCH -next] CIFS: remove set but not used variables 'cinode' and 'netfid' YueHaibing
2019-10-19 15:32 ` Steve French

Linux-CIFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-cifs/0 linux-cifs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-cifs linux-cifs/ https://lore.kernel.org/linux-cifs \
		linux-cifs@vger.kernel.org
	public-inbox-index linux-cifs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-cifs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git