diff mbox series

cifs: remove redundant initialization of variable rc

Message ID 20200527125031.173987-1-colin.king@canonical.com (mailing list archive)
State New, archived
Headers show
Series cifs: remove redundant initialization of variable rc | expand

Commit Message

Colin King May 27, 2020, 12:50 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable rc is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/cifs/cifssmb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve French May 30, 2020, 9:08 p.m. UTC | #1
merged into cifs-2.6.git for-next


On Wed, May 27, 2020 at 7:52 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable rc is being initialized with a value that is never read
> and it is being updated later with a new value.  The initialization is
> redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  fs/cifs/cifssmb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
> index 5014a82391ff..d62f9175c546 100644
> --- a/fs/cifs/cifssmb.c
> +++ b/fs/cifs/cifssmb.c
> @@ -2375,7 +2375,7 @@ int
>  CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
>               unsigned int *nbytes, struct kvec *iov, int n_vec)
>  {
> -       int rc = -EACCES;
> +       int rc;
>         WRITE_REQ *pSMB = NULL;
>         int wct;
>         int smb_hdr_len;
> --
> 2.25.1
>


--
Thanks,

Steve
diff mbox series

Patch

diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 5014a82391ff..d62f9175c546 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -2375,7 +2375,7 @@  int
 CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
 	      unsigned int *nbytes, struct kvec *iov, int n_vec)
 {
-	int rc = -EACCES;
+	int rc;
 	WRITE_REQ *pSMB = NULL;
 	int wct;
 	int smb_hdr_len;