All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Qinglang Miao <miaoqinglang@huawei.com>
Cc: Johan Hovold <johan@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] gnss: simplify the return expression of gnss_uevent
Date: Thu, 8 Oct 2020 16:42:47 +0200	[thread overview]
Message-ID: <20201008144247.GJ26280@localhost> (raw)
In-Reply-To: <20200921131028.91837-1-miaoqinglang@huawei.com>

On Mon, Sep 21, 2020 at 09:10:28PM +0800, Qinglang Miao wrote:
> Simplify the return expression.
> 
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>

The current code was written with an explicit error path on purpose, and
there's no need to change it.

Same applies to your other gnss ubx patch.

> ---
>  drivers/gnss/core.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gnss/core.c b/drivers/gnss/core.c
> index e6f94501c..e6b9ac9da 100644
> --- a/drivers/gnss/core.c
> +++ b/drivers/gnss/core.c
> @@ -368,13 +368,8 @@ ATTRIBUTE_GROUPS(gnss);
>  static int gnss_uevent(struct device *dev, struct kobj_uevent_env *env)
>  {
>  	struct gnss_device *gdev = to_gnss_device(dev);
> -	int ret;
>  
> -	ret = add_uevent_var(env, "GNSS_TYPE=%s", gnss_type_name(gdev));
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	return add_uevent_var(env, "GNSS_TYPE=%s", gnss_type_name(gdev));
>  }
>  
>  static int __init gnss_module_init(void)

Johan

  reply	other threads:[~2020-10-08 14:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 13:10 [PATCH -next] gnss: simplify the return expression of gnss_uevent Qinglang Miao
2020-10-08 14:42 ` Johan Hovold [this message]
2020-10-09  1:10   ` miaoqinglang

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=20201008144247.GJ26280@localhost \
    --to=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miaoqinglang@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 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.