From: Johan Hovold <johan@kernel.org>
To: Liu Shixin <liushixin2@huawei.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] staging: greybus: simplify the return expression of gb_svc_add()
Date: Tue, 15 Sep 2020 11:39:29 +0200 [thread overview]
Message-ID: <20200915093929.GM24441@localhost> (raw)
In-Reply-To: <20200915032630.1772621-1-liushixin2@huawei.com>
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
prev parent reply other threads:[~2020-09-15 9:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 3:26 [PATCH -next] staging: greybus: simplify the return expression of gb_svc_add() Liu Shixin
2020-09-15 9:39 ` 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=20200915093929.GM24441@localhost \
--to=johan@kernel.org \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liushixin2@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.