public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Denis Efremov <efremov@linux.com>
Cc: Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] greybus: remove excessive check in gb_connection_hd_cport_quiesce()
Date: Thu, 26 Sep 2019 07:57:15 +0200	[thread overview]
Message-ID: <20190926055715.GI14159@localhost> (raw)
In-Reply-To: <20190925213656.8950-1-efremov@linux.com>

On Thu, Sep 26, 2019 at 12:36:56AM +0300, Denis Efremov wrote:
> Function pointer "hd->driver->cport_quiesce" is already checked
> at the beginning of gb_connection_hd_cport_quiesce(). Thus, the
> second check can be removed.
> 
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  drivers/greybus/connection.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/greybus/connection.c b/drivers/greybus/connection.c
> index fc8f57f97ce6..e3799a53a193 100644
> --- a/drivers/greybus/connection.c
> +++ b/drivers/greybus/connection.c
> @@ -361,9 +361,6 @@ static int gb_connection_hd_cport_quiesce(struct gb_connection *connection)
>  	if (connection->mode_switch)
>  		peer_space += sizeof(struct gb_operation_msg_hdr);
>  
> -	if (!hd->driver->cport_quiesce)
> -		return 0;
> -
>  	ret = hd->driver->cport_quiesce(hd, connection->hd_cport_id,
>  					peer_space,
>  					GB_CONNECTION_CPORT_QUIESCE_TIMEOUT);

Nice catch, thanks.

Acked-by: Johan Hovold <johan@kernel.org>

      reply	other threads:[~2019-09-26  5:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 21:36 [PATCH] greybus: remove excessive check in gb_connection_hd_cport_quiesce() Denis Efremov
2019-09-26  5:57 ` 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=20190926055715.GI14159@localhost \
    --to=johan@kernel.org \
    --cc=efremov@linux.com \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox