mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] futex: Remove unneeded gotos
@ 2020-12-30 12:29 6812skiii
  2021-01-27 19:31 ` [tip: locking/core] " tip-bot2 for Jangwoong Kim
  2021-01-28 12:21 ` tip-bot2 for Jangwoong Kim
  0 siblings, 2 replies; 3+ messages in thread
From: 6812skiii @ 2020-12-30 12:29 UTC (permalink / raw)
  To: tglx, mingo; +Cc: peterz, dvhart, linux-kernel, Jangwoong Kim

From: Jangwoong Kim <6812skiii@gmail.com>

Get rid of gotos that do not contain any cleanup.

According to coding style documentation: "If there is no
cleanup needed then just return directly"

Signed-off-by: Jangwoong Kim <6812skiii@gmail.com>
---
 kernel/futex.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/futex.c b/kernel/futex.c
index c47d1015d759..0490d7e7fe7f 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -3024,7 +3024,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
 		 * Success, we're done! No tricky corner cases.
 		 */
 		if (!ret)
-			goto out_putkey;
+			return ret;
 		/*
 		 * The atomic access to the futex value generated a
 		 * pagefault, so retry the user-access and the wakeup:
@@ -3041,7 +3041,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
 		 * wake_futex_pi has detected invalid state. Tell user
 		 * space.
 		 */
-		goto out_putkey;
+		return ret;
 	}
 
 	/*
@@ -3062,7 +3062,7 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
 
 		default:
 			WARN_ON_ONCE(1);
-			goto out_putkey;
+			return ret;
 		}
 	}
 
@@ -3073,7 +3073,6 @@ static int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)
 
 out_unlock:
 	spin_unlock(&hb->lock);
-out_putkey:
 	return ret;
 
 pi_retry:
-- 
2.17.1


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

end of thread, other threads:[~2021-01-28 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 12:29 [PATCH] futex: Remove unneeded gotos 6812skiii
2021-01-27 19:31 ` [tip: locking/core] " tip-bot2 for Jangwoong Kim
2021-01-28 12:21 ` tip-bot2 for Jangwoong Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®