From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: <vkoul@kernel.org>, <yung-chuan.liao@linux.intel.com>,
<pierre-louis.bossart@linux.intel.com>, <sanyog.r.kale@intel.com>
Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org,
Richard Fitzgerald <rf@opensource.cirrus.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] soundwire: cadence: Simplify error paths in cdns_xfer_msg()
Date: Sat, 17 Sep 2022 16:48:22 +0100 [thread overview]
Message-ID: <20220917154822.690472-2-rf@opensource.cirrus.com> (raw)
In-Reply-To: <20220917154822.690472-1-rf@opensource.cirrus.com>
There's no need to goto an exit label to return from cdns_xfer_msg().
It doesn't do any cleanup, only a return statement.
Replace the gotos with returns.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
drivers/soundwire/cadence_master.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
index 3543a923ee6b..30b8c628fdbd 100644
--- a/drivers/soundwire/cadence_master.c
+++ b/drivers/soundwire/cadence_master.c
@@ -709,17 +709,14 @@ cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg)
ret = _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN,
CDNS_MCP_CMD_LEN, false);
if (ret != SDW_CMD_OK)
- goto exit;
+ return ret;
}
if (!(msg->len % CDNS_MCP_CMD_LEN))
- goto exit;
+ return SDW_CMD_OK;
- ret = _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN,
- msg->len % CDNS_MCP_CMD_LEN, false);
-
-exit:
- return ret;
+ return _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN,
+ msg->len % CDNS_MCP_CMD_LEN, false);
}
EXPORT_SYMBOL(cdns_xfer_msg);
--
2.30.2
WARNING: multiple messages have this Message-ID (diff)
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: <vkoul@kernel.org>, <yung-chuan.liao@linux.intel.com>,
<pierre-louis.bossart@linux.intel.com>, <sanyog.r.kale@intel.com>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
<patches@opensource.cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>
Subject: [PATCH 2/2] soundwire: cadence: Simplify error paths in cdns_xfer_msg()
Date: Sat, 17 Sep 2022 16:48:22 +0100 [thread overview]
Message-ID: <20220917154822.690472-2-rf@opensource.cirrus.com> (raw)
In-Reply-To: <20220917154822.690472-1-rf@opensource.cirrus.com>
There's no need to goto an exit label to return from cdns_xfer_msg().
It doesn't do any cleanup, only a return statement.
Replace the gotos with returns.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
drivers/soundwire/cadence_master.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
index 3543a923ee6b..30b8c628fdbd 100644
--- a/drivers/soundwire/cadence_master.c
+++ b/drivers/soundwire/cadence_master.c
@@ -709,17 +709,14 @@ cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg)
ret = _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN,
CDNS_MCP_CMD_LEN, false);
if (ret != SDW_CMD_OK)
- goto exit;
+ return ret;
}
if (!(msg->len % CDNS_MCP_CMD_LEN))
- goto exit;
+ return SDW_CMD_OK;
- ret = _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN,
- msg->len % CDNS_MCP_CMD_LEN, false);
-
-exit:
- return ret;
+ return _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN,
+ msg->len % CDNS_MCP_CMD_LEN, false);
}
EXPORT_SYMBOL(cdns_xfer_msg);
--
2.30.2
next prev parent reply other threads:[~2022-09-17 15:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-17 15:48 [PATCH 1/2] soundwire: cadence: Fix error check in cdns_xfer_msg() Richard Fitzgerald
2022-09-17 15:48 ` Richard Fitzgerald
2022-09-17 15:48 ` Richard Fitzgerald [this message]
2022-09-17 15:48 ` [PATCH 2/2] soundwire: cadence: Simplify error paths " Richard Fitzgerald
2022-09-19 8:48 ` Pierre-Louis Bossart
2022-09-19 8:48 ` Pierre-Louis Bossart
2022-09-19 8:48 ` [PATCH 1/2] soundwire: cadence: Fix error check " Pierre-Louis Bossart
2022-09-20 5:07 ` Vinod Koul
2022-09-20 5:07 ` Vinod Koul
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=20220917154822.690472-2-rf@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=sanyog.r.kale@intel.com \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/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 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.