lkml.org 
[lkml]   [2020]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@huawei.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

\
 
 \ /
  Last update: 2020-09-15 11:40    [W:0.065 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site