public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] greybus: remove excessive check in gb_connection_hd_cport_quiesce()
@ 2019-09-25 21:36 Denis Efremov
  2019-09-26  5:57 ` Johan Hovold
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Efremov @ 2019-09-25 21:36 UTC (permalink / raw)
  To: Johan Hovold, Alex Elder, Greg Kroah-Hartman
  Cc: Denis Efremov, greybus-dev, linux-kernel

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);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] greybus: remove excessive check in gb_connection_hd_cport_quiesce()
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2019-09-26  5:57 UTC (permalink / raw)
  To: Denis Efremov
  Cc: Johan Hovold, Alex Elder, Greg Kroah-Hartman, greybus-dev,
	linux-kernel

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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-26  5:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox