All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipc/sem: Remove redundant assignments
@ 2022-04-09 10:19 Michal Orzel
  2022-04-09 10:19 ` [PATCH] block: " Michal Orzel
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Michal Orzel @ 2022-04-09 10:19 UTC (permalink / raw)
  To: Nathan Chancellor, Nick Desaulniers, Tom Rix
  Cc: Michal Orzel, linux-kernel, llvm

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>
---
 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:
 	{
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-04-12 15:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH] ipc/sem: " Tom Rix
2022-04-11 15:47 ` Nathan Chancellor
2022-04-12 15:19   ` Michal Orzel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.