Skip to contentSkip to conversation

greybus: remove excessive check in gb_connection_hd_cport_quiesce()

PATCH In review Denis Efremov 2 participants 2 messages Sep 25, 2019 – Sep 26, 2019 Greybus

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 greybus: remove excessive check in gb_connection_hd_cport_quiesce()

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.

---
 drivers/greybus/connection.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/greybus/connection.c +0 -3
index fc8f57f97ce6..e3799a53a193 100644
@@ -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);
Signature · 1 line
2.21.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Denis Efremov

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.

---
 drivers/greybus/connection.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/greybus/connection.c +0 -0
index fc8f57f97ce6..e3799a53a193 100644

drivers/greybus/connection.c static int gb_connection_hd_cport_quiesce(struct gb_connection *connection) · line 366

Quoted 9 lines
drivers/greybus/connection.c +0 -3
@@ -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.