gfs2.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: Su Hui <suhui@nfschina.com>
Cc: rpeterso@redhat.com, nathan@kernel.org, ndesaulniers@google.com,
	 trix@redhat.com, gfs2@lists.linux.dev,
	linux-kernel@vger.kernel.org,  llvm@lists.linux.dev,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] gfs2: remove dead code in __acquires
Date: Thu, 2 Nov 2023 12:50:47 +0100	[thread overview]
Message-ID: <CAHc6FU5H-Ju9129Xr3RGA6DePDL58tQ7nOkSJXdig4gJc1w+WA@mail.gmail.com> (raw)
In-Reply-To: <20231102015141.1355762-1-suhui@nfschina.com>

On Thu, Nov 2, 2023 at 2:54 AM Su Hui <suhui@nfschina.com> wrote:
>
> clang static analyzer complains that value stored to 'gh' is never read.
> The code of this line is useless after commit 0b93bac2271e
> ("gfs2: Remove LM_FLAG_PRIORITY flag"). Remove this code to save space.
>
> Signed-off-by: Su Hui <suhui@nfschina.com>
> ---
>  fs/gfs2/glock.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
> index 3772a5d9e85c..347f8a020c82 100644
> --- a/fs/gfs2/glock.c
> +++ b/fs/gfs2/glock.c
> @@ -1524,7 +1524,6 @@ __acquires(&gl->gl_lockref.lock)
>                 return;
>         }
>         list_add_tail(&gh->gh_list, insert_pt);
> -       gh = list_first_entry(&gl->gl_holders, struct gfs2_holder, gh_list);
>         spin_unlock(&gl->gl_lockref.lock);
>         if (sdp->sd_lockstruct.ls_ops->lm_cancel)
>                 sdp->sd_lockstruct.ls_ops->lm_cancel(gl);
> --
> 2.30.2
>

Thanks, I'll add this.

(The subject "gfs2: remove dead code in __acquires" is misleading
because the function this is in is called add_to_queue(); __acquires
is just an annotation.)

Andreas


      reply	other threads:[~2023-11-02 11:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02  1:51 [PATCH] gfs2: remove dead code in __acquires Su Hui
2023-11-02 11:50 ` Andreas Gruenbacher [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=CAHc6FU5H-Ju9129Xr3RGA6DePDL58tQ7nOkSJXdig4gJc1w+WA@mail.gmail.com \
    --to=agruenba@redhat.com \
    --cc=gfs2@lists.linux.dev \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=rpeterso@redhat.com \
    --cc=suhui@nfschina.com \
    --cc=trix@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).