diff mbox series

[1/4] smb: client: Delete unused value

Message ID b9f9f617abc69d0a7ddb3109bc257073c8b165de.1701060106.git.pierre.mariani@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/4] smb: client: Delete unused value | expand

Commit Message

Pierre Mariani Nov. 27, 2023, 4:52 a.m. UTC
rc does not need to be set to any value in this location as it gets set to other
values is all subsequent logical branches before being used.
Fixes Coverity 1562035 Unused value.

Signed-off-by: Pierre Mariani <pierre.mariani@gmail.com>
---
 fs/smb/client/connect.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Steve French Nov. 27, 2023, 4:54 a.m. UTC | #1
on this one - I lean toward leaving it in (although technically
unused) since may reduce future errors by being clear that this is not
an error case and may be a bit clearer to read to some.  No strong
opinion though on this.

On Sun, Nov 26, 2023 at 10:52 PM Pierre Mariani
<pierre.mariani@gmail.com> wrote:
>
> rc does not need to be set to any value in this location as it gets set to other
> values is all subsequent logical branches before being used.
> Fixes Coverity 1562035 Unused value.
>
> Signed-off-by: Pierre Mariani <pierre.mariani@gmail.com>
> ---
>  fs/smb/client/connect.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
> index f896f60c924b..449d56802692 100644
> --- a/fs/smb/client/connect.c
> +++ b/fs/smb/client/connect.c
> @@ -1770,7 +1770,6 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,
>                         tcp_ses, (struct sockaddr *)&ctx->dstaddr);
>                 if (tcp_ses->smbd_conn) {
>                         cifs_dbg(VFS, "RDMA transport established\n");
> -                       rc = 0;
>                         goto smbd_connected;
>                 } else {
>                         rc = -ENOENT;
> --
> 2.39.2
>
Pierre Mariani Nov. 27, 2023, 5:15 a.m. UTC | #2
On Sun, Nov 26, 2023 at 10:54:38PM -0600, Steve French wrote:
> on this one - I lean toward leaving it in (although technically
> unused) since may reduce future errors by being clear that this is not
> an error case and may be a bit clearer to read to some.  No strong
> opinion though on this.
> 

I will undo this change and update the Coverity triage data instead.

> On Sun, Nov 26, 2023 at 10:52 PM Pierre Mariani
> <pierre.mariani@gmail.com> wrote:
> >
> > rc does not need to be set to any value in this location as it gets set to other
> > values is all subsequent logical branches before being used.
> > Fixes Coverity 1562035 Unused value.
> >
> > Signed-off-by: Pierre Mariani <pierre.mariani@gmail.com>
> > ---
> >  fs/smb/client/connect.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
> > index f896f60c924b..449d56802692 100644
> > --- a/fs/smb/client/connect.c
> > +++ b/fs/smb/client/connect.c
> > @@ -1770,7 +1770,6 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,
> >                         tcp_ses, (struct sockaddr *)&ctx->dstaddr);
> >                 if (tcp_ses->smbd_conn) {
> >                         cifs_dbg(VFS, "RDMA transport established\n");
> > -                       rc = 0;
> >                         goto smbd_connected;
> >                 } else {
> >                         rc = -ENOENT;
> > --
> > 2.39.2
> >
> 
> 
> -- 
> Thanks,
> 
> Steve
Pierre Mariani Nov. 28, 2023, 5:20 a.m. UTC | #3
On Sun, Nov 26, 2023 at 09:15:07PM -0800, Pierre Mariani wrote:
> On Sun, Nov 26, 2023 at 10:54:38PM -0600, Steve French wrote:
> > on this one - I lean toward leaving it in (although technically
> > unused) since may reduce future errors by being clear that this is not
> > an error case and may be a bit clearer to read to some.  No strong
> > opinion though on this.
> > 
> 
> I will undo this change and update the Coverity triage data instead.

I will not be able to make updates to Coverity until I get contributor access,
which will happen if and when one of my patches gets merged. I will update
Coverity whenever it becomes possible.

I have undone the change and submitted a v2 patch set.

> 
> > On Sun, Nov 26, 2023 at 10:52 PM Pierre Mariani
> > <pierre.mariani@gmail.com> wrote:
> > >
> > > rc does not need to be set to any value in this location as it gets set to other
> > > values is all subsequent logical branches before being used.
> > > Fixes Coverity 1562035 Unused value.
> > >
> > > Signed-off-by: Pierre Mariani <pierre.mariani@gmail.com>
> > > ---
> > >  fs/smb/client/connect.c | 1 -
> > >  1 file changed, 1 deletion(-)
> > >
> > > diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
> > > index f896f60c924b..449d56802692 100644
> > > --- a/fs/smb/client/connect.c
> > > +++ b/fs/smb/client/connect.c
> > > @@ -1770,7 +1770,6 @@ cifs_get_tcp_session(struct smb3_fs_context *ctx,
> > >                         tcp_ses, (struct sockaddr *)&ctx->dstaddr);
> > >                 if (tcp_ses->smbd_conn) {
> > >                         cifs_dbg(VFS, "RDMA transport established\n");
> > > -                       rc = 0;
> > >                         goto smbd_connected;
> > >                 } else {
> > >                         rc = -ENOENT;
> > > --
> > > 2.39.2
> > >
> > 
> > 
> > -- 
> > Thanks,
> > 
> > Steve
diff mbox series

Patch

diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index f896f60c924b..449d56802692 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -1770,7 +1770,6 @@  cifs_get_tcp_session(struct smb3_fs_context *ctx,
 			tcp_ses, (struct sockaddr *)&ctx->dstaddr);
 		if (tcp_ses->smbd_conn) {
 			cifs_dbg(VFS, "RDMA transport established\n");
-			rc = 0;
 			goto smbd_connected;
 		} else {
 			rc = -ENOENT;