[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200915093929.GM24441@localhost>
Date: Tue, 15 Sep 2020 11:39:29 +0200
From: Johan Hovold <johan@...nel.org>
To: Liu Shixin <liushixin2@...wei.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Johan Hovold <johan@...nel.org>, Alex Elder <elder@...nel.org>,
greybus-dev@...ts.linaro.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] staging: greybus: simplify the return expression
of gb_svc_add()
On Tue, Sep 15, 2020 at 11:26:30AM +0800, Liu Shixin wrote:
> Simplify the return expression.
>
> Signed-off-by: Liu Shixin <liushixin2@...wei.com>
> ---
> drivers/greybus/svc.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/greybus/svc.c b/drivers/greybus/svc.c
> index ce7740ef449b..dca251172cd2 100644
> --- a/drivers/greybus/svc.c
> +++ b/drivers/greybus/svc.c
> @@ -1345,18 +1345,12 @@ struct gb_svc *gb_svc_create(struct gb_host_device *hd)
>
> int gb_svc_add(struct gb_svc *svc)
> {
> - int ret;
> -
> /*
> * The SVC protocol is currently driven by the SVC, so the SVC device
> * is added from the connection request handler when enough
> * information has been received.
> */
> - ret = gb_connection_enable(svc->connection);
> - if (ret)
> - return ret;
> -
> - return 0;
> + return gb_connection_enable(svc->connection);
There no need for this change. This code was written with an explicit
success path on purpose.
Also, this driver doesn't live in staging anymore as your patch prefix
suggests.
> }
>
> static void gb_svc_remove_modules(struct gb_svc *svc)
Johan
Powered by blists - more mailing lists