From: Michal Orzel Date: Tue, 10 May 2022 01:29:20 +0000 (-0700) Subject: ipc/sem: remove redundant assignments X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0e900029655327bb5326ced02eff97667a079039;p=linux.git ipc/sem: remove redundant assignments 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 Reviewed-by: Tom Rix Reviewed-by: Nathan Chancellor Cc: Nick Desaulniers Signed-off-by: Andrew Morton --- diff --git a/ipc/sem.c b/ipc/sem.c index 0dbdb98fdf2d9..38ef91a63edd5 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: {