Skip to content

Commit

Permalink
ipc/sem: remove redundant assignments
Browse files Browse the repository at this point in the history
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]

Link: https://lkml.kernel.org/r/20220409101933.207157-1-michalorzel.eng@gmail.com
Signed-off-by: Michal Orzel <michalorzel.eng@gmail.com>
Reviewed-by: Tom Rix <trix@redhat.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
orzelmichal authored and akpm00 committed May 10, 2022
1 parent 800c24d commit 0e90002
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
{
Expand Down

0 comments on commit 0e90002

Please sign in to comment.