mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Zheng Yongjun <zhengyongjun3@huawei.com>
Cc: johan@kernel.org, matthias.bgg@gmail.com,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH -next] drivers: gnss: simplify the gnss code return expression
Date: Mon, 11 Jan 2021 11:13:43 +0100	[thread overview]
Message-ID: <X/wk15eOf/gmVbe9@hovoldconsulting.com> (raw)
In-Reply-To: <20201210135142.1138-1-zhengyongjun3@huawei.com>

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@huawei.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

      reply	other threads:[~2021-01-11 10:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 13:51 Zheng Yongjun
2021-01-11 10:13 ` 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=X/wk15eOf/gmVbe9@hovoldconsulting.com \
    --to=johan@kernel.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 \
    --cc=zhengyongjun3@huawei.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

all inboxes | Powered by JetHome®