[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <X/wk15eOf/gmVbe9@hovoldconsulting.com>
Date: Mon, 11 Jan 2021 11:13:43 +0100
From: Johan Hovold <johan@...nel.org>
To: Zheng Yongjun <zhengyongjun3@...wei.com>
Cc: johan@...nel.org, matthias.bgg@...il.com,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH -next] drivers: gnss: simplify the gnss code return
expression
On Thu, Dec 10, 2020 at 09:51:42PM +0800, Zheng Yongjun wrote:
> Simplify the return expression at diffrent .c file, fix this all.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
> ---
> drivers/gnss/core.c | 7 +------
> drivers/gnss/mtk.c | 14 ++------------
> drivers/gnss/ubx.c | 14 ++------------
> 3 files changed, 5 insertions(+), 30 deletions(-)
> static int __init gnss_module_init(void)
> diff --git a/drivers/gnss/mtk.c b/drivers/gnss/mtk.c
> index d1fc55560daf..451cb6e66ec3 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);
> }
These functions where written with explicit success paths on purpose so
there's nothing to "fix" here.
Johan
Powered by blists - more mailing lists