All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: Bharath SM <bharathsm.hsk@gmail.com>
Cc: linux-cifs@vger.kernel.org, bharathsm@microsoft.com
Subject: Re: [PATCH] cifs: remove redundant variable assignment
Date: Wed, 13 Mar 2024 21:49:05 -0500	[thread overview]
Message-ID: <CAH2r5mvu3Rwbv=b86MwOTYv5W4U4x7+OpM2DMCfwEvyvAEYsEg@mail.gmail.com> (raw)
In-Reply-To: <20240313150034.165152-1-bharathsm@microsoft.com>

The second change in this looks a few lines off (didn't you mean to
remove the rc = 0 nine lines earlier, ie the one from the EREMOTE not
the EINVAL calse?).  See below:

        case -EREMOTE:
                cifs_create_junction_fattr(&fattr, inode->i_sb);
                rc = 0;   /* FIX: shouldn't you remove this one */
                break;
        case -EOPNOTSUPP:
        case -EINVAL:
                /*
                 * FIXME: legacy server -- fall back to path-based call?
                 * for now, just skip revalidating and mark inode for
                 * immediate reval.
                 */
-               rc = 0;   /* FIX: and not remove this one ? */
                CIFS_I(inode)->time = 0;
                goto cgfi_exit;
        default:
                goto cgfi_exit;
        }

        /*
         * don't bother with SFU junk here -- just mark inode as needing
         * revalidation.
         */
        fattr.cf_uniqueid = CIFS_I(inode)->uniqueid;
        fattr.cf_flags |= CIFS_FATTR_NEED_REVAL;
        /* if filetype is different, return error */
        rc = cifs_fattr_to_inode(inode, &fattr, false);


On Wed, Mar 13, 2024 at 10:01 AM Bharath SM <bharathsm.hsk@gmail.com> wrote:
>
> This removes an unnecessary variable assignment. The assigned
> value will be overwritten by cifs_fattr_to_inode before it
> is accessed, making the line redundant.
>
> Signed-off-by: Bharath SM <bharathsm@microsoft.com>
> ---
>  fs/smb/client/inode.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
> index 00aae4515a09..50e939234a8e 100644
> --- a/fs/smb/client/inode.c
> +++ b/fs/smb/client/inode.c
> @@ -400,7 +400,6 @@ cifs_get_file_info_unix(struct file *filp)
>                 cifs_unix_basic_to_fattr(&fattr, &find_data, cifs_sb);
>         } else if (rc == -EREMOTE) {
>                 cifs_create_junction_fattr(&fattr, inode->i_sb);
> -               rc = 0;
>         } else
>                 goto cifs_gfiunix_out;
>
> @@ -852,7 +851,6 @@ cifs_get_file_info(struct file *filp)
>                  * for now, just skip revalidating and mark inode for
>                  * immediate reval.
>                  */
> -               rc = 0;
>                 CIFS_I(inode)->time = 0;
>                 goto cgfi_exit;
>         default:
> --
> 2.34.1
>


-- 
Thanks,

Steve

  reply	other threads:[~2024-03-14  2:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 15:00 [PATCH] cifs: remove redundant variable assignment Bharath SM
2024-03-14  2:49 ` Steve French [this message]
2024-03-14 18:14   ` Bharath SM

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='CAH2r5mvu3Rwbv=b86MwOTYv5W4U4x7+OpM2DMCfwEvyvAEYsEg@mail.gmail.com' \
    --to=smfrench@gmail.com \
    --cc=bharathsm.hsk@gmail.com \
    --cc=bharathsm@microsoft.com \
    --cc=linux-cifs@vger.kernel.org \
    /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 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.