From: 6812skiii@gmail.com
To: tglx@linutronix.de, mingo@redhat.com
Cc: peterz@infradead.org, dvhart@infradead.org,
linux-kernel@vger.kernel.org, Jangwoong Kim <6812skiii@gmail.com>
Subject: [PATCH] futex: Remove unneeded gotos
Date: Wed, 30 Dec 2020 21:29:53 +0900 [thread overview]
Message-ID: <20201230122953.10473-1-6812skiii@gmail.com> (raw)
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
next reply other threads:[~2020-12-30 12:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-30 12:29 6812skiii [this message]
2021-01-27 19:31 ` [tip: locking/core] futex: Remove unneeded gotos tip-bot2 for Jangwoong Kim
2021-01-28 12:21 ` tip-bot2 for Jangwoong Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201230122953.10473-1-6812skiii@gmail.com \
--to=6812skiii@gmail.com \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).