llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Tom Rix <trix@redhat.com>
To: Michal Orzel <michalorzel.eng@gmail.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>
Cc: linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] ipc/sem: Remove redundant assignments
Date: Sat, 9 Apr 2022 04:47:00 -0700	[thread overview]
Message-ID: <30aa1413-de9c-ffb9-223f-b091b7990a85@redhat.com> (raw)
In-Reply-To: <20220409101933.207157-1-michalorzel.eng@gmail.com>


On 4/9/22 3:19 AM, Michal Orzel wrote:
> Get rid of redundant assignments which end up in values not being
> read either because they are overwritten or the function ends.
>
> Reported by clang-tidy [deadcode.DeadStores]
>
> Signed-off-by: Michal Orzel <michalorzel.eng@gmail.com>
Reviewed-by: Tom Rix <trix@redhat.com>
> ---
>   ipc/sem.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/ipc/sem.c b/ipc/sem.c
> index 0dbdb98fdf2d..38ef91a63edd 100644
> --- a/ipc/sem.c
> +++ b/ipc/sem.c
> @@ -766,7 +766,6 @@ static int perform_atomic_semop(struct sem_array *sma, struct sem_queue *q)
>   	for (sop = sops; sop < sops + nsops; sop++) {
>   		curr = &sma->sems[sop->sem_num];
>   		sem_op = sop->sem_op;
> -		result = curr->semval;
>   
>   		if (sop->sem_flg & SEM_UNDO) {
>   			int undo = un->semadj[sop->sem_num] - sem_op;
> @@ -1430,7 +1429,6 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,
>   	if (err)
>   		goto out_rcu_wakeup;
>   
> -	err = -EACCES;
>   	switch (cmd) {
>   	case GETALL:
>   	{


  parent reply	other threads:[~2022-04-09 11:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-09 10:19 [PATCH] ipc/sem: Remove redundant assignments Michal Orzel
2022-04-09 10:19 ` [PATCH] block: " Michal Orzel
2022-04-09 12:01   ` Tom Rix
2022-04-09 13:20     ` Michal Orzel
2022-04-09 16:03       ` Tom Rix
2022-04-12 15:23         ` Michal Orzel
2022-04-09 11:47 ` Tom Rix [this message]
2022-04-11 15:47 ` [PATCH] ipc/sem: " Nathan Chancellor
2022-04-12 15:19   ` Michal Orzel

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=30aa1413-de9c-ffb9-223f-b091b7990a85@redhat.com \
    --to=trix@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=michalorzel.eng@gmail.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.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 NNTP newsgroup(s).