From: Johan Hovold <johan@kernel.org>
To: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] gnss: mtk: Simplify return variables in mtk_set_active and mtk_set_standby
Date: Tue, 14 Jan 2025 16:10:00 +0100 [thread overview]
Message-ID: <Z4Z-SJZIekQ3SjP4@hovoldconsulting.com> (raw)
In-Reply-To: <20241117052501.1138926-1-iwamatsu@nigauri.org>
On Sun, Nov 17, 2024 at 02:25:01PM +0900, Nobuhiro Iwamatsu wrote:
> Simply return directly instead of assign the return value.
>
> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
> ---
> drivers/gnss/mtk.c | 14 ++------------
> 1 file changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gnss/mtk.c b/drivers/gnss/mtk.c
> index c62b1211f4fe4e..be20f6d6470736 100644
> --- a/drivers/gnss/mtk.c
> +++ b/drivers/gnss/mtk.c
> @@ -24,25 +24,15 @@ struct mtk_data {
> static int mtk_set_active(struct gnss_serial *gserial)
> {
> struct mtk_data *data = gnss_serial_get_drvdata(gserial);
> - int ret;
>
> - ret = regulator_enable(data->vcc);
> - if (ret)
> - return ret;
> -
> - return 0;
> + return regulator_enable(data->vcc);
The current style with separate success and error paths was used on
purpose (e.g. to make it obvious from just looking at this function to
determine what is returned).
Johan
prev parent reply other threads:[~2025-01-14 15:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-17 5:25 [PATCH] gnss: mtk: Simplify return variables in mtk_set_active and mtk_set_standby Nobuhiro Iwamatsu
2024-11-18 6:44 ` AngeloGioacchino Del Regno
2025-01-14 15:10 ` Johan Hovold [this message]
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=Z4Z-SJZIekQ3SjP4@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=iwamatsu@nigauri.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox