From: Greg Kurz <groug@kaod.org>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>,
Greg Kurz <groug@kaod.org>
Subject: [PULL 5/5] 9pfs/9p.c: remove unneeded labels
Date: Mon, 20 Jan 2020 18:06:40 +0100 [thread overview]
Message-ID: <20200120170640.524184-6-groug@kaod.org> (raw)
In-Reply-To: <20200120170640.524184-1-groug@kaod.org>
From: Daniel Henrique Barboza <danielhb413@gmail.com>
'out' label in v9fs_xattr_write() and 'out_nofid' label in
v9fs_complete_rename() can be replaced by appropriate return
calls.
CC: Greg Kurz <groug@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Acked-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Greg Kurz <groug@kaod.org>
---
hw/9pfs/9p.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 8b247b904ec7..b0e445d6bd5a 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -2472,8 +2472,7 @@ static int v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
if (fidp->fs.xattr.len < off) {
- err = -ENOSPC;
- goto out;
+ return -ENOSPC;
}
write_count = fidp->fs.xattr.len - off;
if (write_count > count) {
@@ -2499,7 +2498,7 @@ static int v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
off += to_copy;
write_count -= to_copy;
}
-out:
+
return err;
}
@@ -3067,8 +3066,7 @@ static int coroutine_fn v9fs_complete_rename(V9fsPDU *pdu, V9fsFidState *fidp,
if (newdirfid != -1) {
dirfidp = get_fid(pdu, newdirfid);
if (dirfidp == NULL) {
- err = -ENOENT;
- goto out_nofid;
+ return -ENOENT;
}
if (fidp->fid_type != P9_FID_NONE) {
err = -EINVAL;
@@ -3111,7 +3109,6 @@ out:
put_fid(pdu, dirfidp);
}
v9fs_path_free(&new_path);
-out_nofid:
return err;
}
--
2.21.1
next prev parent reply other threads:[~2020-01-20 17:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-20 17:06 [PULL 0/5] 9p patches 2020-01-20 Greg Kurz
2020-01-20 17:06 ` [PULL 1/5] 9pfs: local: Fix possible memory leak in local_link() Greg Kurz
2020-01-20 17:06 ` [PULL 2/5] 9p: local: always return -1 on error in local_unlinkat_common Greg Kurz
2020-01-20 17:06 ` [PULL 3/5] 9p: init_in_iov_from_pdu can truncate the size Greg Kurz
2020-01-20 17:06 ` [PULL 4/5] virtfs-proxy-helper.c: remove 'err_out' label in setugid() Greg Kurz
2020-01-20 17:06 ` Greg Kurz [this message]
2020-01-21 10:54 ` [PULL 0/5] 9p patches 2020-01-20 Peter Maydell
-- strict thread matches above, loose matches on Subject: below --
2020-01-14 16:02 [PULL 0/5] 9p patches 2020-01-14 Greg Kurz
2020-01-14 16:02 ` [PULL 5/5] 9pfs/9p.c: remove unneeded labels Greg Kurz
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=20200120170640.524184-6-groug@kaod.org \
--to=groug@kaod.org \
--cc=danielhb413@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).