Skip to content

Commit 0e90002

Browse files
orzelmichalakpm00
authored andcommitted
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>
1 parent 800c24d commit 0e90002

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

ipc/sem.c

-2
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,6 @@ static int perform_atomic_semop(struct sem_array *sma, struct sem_queue *q)
766766
for (sop = sops; sop < sops + nsops; sop++) {
767767
curr = &sma->sems[sop->sem_num];
768768
sem_op = sop->sem_op;
769-
result = curr->semval;
770769

771770
if (sop->sem_flg & SEM_UNDO) {
772771
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,
14301429
if (err)
14311430
goto out_rcu_wakeup;
14321431

1433-
err = -EACCES;
14341432
switch (cmd) {
14351433
case GETALL:
14361434
{

0 commit comments

Comments
 (0)