[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201008144247.GJ26280@localhost>
Date: Thu, 8 Oct 2020 16:42:47 +0200
From: Johan Hovold <johan@...nel.org>
To: Qinglang Miao <miaoqinglang@...wei.com>
Cc: Johan Hovold <johan@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] gnss: simplify the return expression of gnss_uevent
On Mon, Sep 21, 2020 at 09:10:28PM +0800, Qinglang Miao wrote:
> Simplify the return expression.
>
> Signed-off-by: Qinglang Miao <miaoqinglang@...wei.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
Powered by blists - more mailing lists