linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
To: mateusznosek0@gmail.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	hughd@google.com,  Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/shmem.c: Clean code by removing unnecessary assignment
Date: Mon, 2 Mar 2020 09:54:27 +0100	[thread overview]
Message-ID: <CAM9Jb+g-LR+XRE5sGwM9VTT13jwzyvwWTqDbeZEmPCJv2aY-2w@mail.gmail.com> (raw)
In-Reply-To: <20200301152832.24595-1-mateusznosek0@gmail.com>

> From: Mateusz Nosek <mateusznosek0@gmail.com>
>
> Previously 0 was assigned to variable 'error'
> but the variable was never read before reassignemnt later.
> So the assignment can be removed.
>
> Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
> ---
>  mm/shmem.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 31b4bcc95f17..84eb14f5509c 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -3116,12 +3116,9 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
>
>         error = security_inode_init_security(inode, dir, &dentry->d_name,
>                                              shmem_initxattrs, NULL);
> -       if (error) {
> -               if (error != -EOPNOTSUPP) {
> -                       iput(inode);
> -                       return error;
> -               }
> -               error = 0;
> +       if (error && error != -EOPNOTSUPP) {
> +               iput(inode);
> +               return error;
>         }
>
>         inode->i_size = len-1;
> --
> 2.17.1

Acked-by : Pankaj Gupta <pankaj.gupta.linux@gmail.com>

>
>


      parent reply	other threads:[~2020-03-02  8:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 15:28 mateusznosek0
2020-03-01 16:54 ` Matthew Wilcox
2020-03-02  8:54 ` Pankaj Gupta [this message]

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=CAM9Jb+g-LR+XRE5sGwM9VTT13jwzyvwWTqDbeZEmPCJv2aY-2w@mail.gmail.com \
    --to=pankaj.gupta.linux@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mateusznosek0@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox