greybus: remove excessive check in gb_connection_hd_cport_quiesce()
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.
Signed-off-by Denis Efremov <[email protected]>
--- drivers/greybus/connection.c | 3 --- 1 file changed, 3 deletions(-)
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 );
Signature · 1 line
2.21.0
Quoted 14 lines · Denis Efremov
Function pointer "
hd->driver->cport_quiesce" is already checked at the beginning ofgb_connection_hd_cport_quiesce(). Thus, the second check can be removed.Signed-off-by Denis Efremov <[email protected]>--- drivers/greybus/connection.c | 3 --- 1 file changed, 3 deletions(-)drivers/greybus/connection.c +0
-0
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.
Acked-by Johan Hovold <[email protected]>