summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorMichal Orzel <michalorzel.eng@gmail.com>2022-05-09 18:29:20 -0700
committerakpm <akpm@linux-foundation.org>2022-05-09 18:29:20 -0700
commit0e900029655327bb5326ced02eff97667a079039 (patch)
treec859913d8d2bce354b1f22d0f1ceef3c7d444722 /ipc
parent800c24dc34b93d2014f3952683f8d5e9309e1b73 (diff)
downloadlinux-stable-0e900029655327bb5326ced02eff97667a079039.tar.gz
linux-stable-0e900029655327bb5326ced02eff97667a079039.tar.bz2
linux-stable-0e900029655327bb5326ced02eff97667a079039.zip
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 <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>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/sem.c2
1 files changed, 0 insertions, 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:
{