usb: typec: tcpm: turn tcpm_ams_finish into void function
Subsystems (3)
PATCH v2 1/1 usb: typec: tcpm: turn tcpm_ams_finish into void function
This function always return '0' and no callers use the return value. So make it a void function.
This eliminates the following coccicheck warning:
./drivers/usb/typec/tcpm/tcpm.c:778:5-8: Unneeded variable: "ret". Return "0" on line 794
---
Change in v2:
-remove the unnecessary return statement
drivers/usb/typec/tcpm/tcpm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/usb/typec/tcpm/tcpm.c +1 -5
@@ -773,10 +773,8 @@ static enum typec_cc_status tcpm_rp_cc(struct tcpm_port *port)return TYPEC_CC_RP_DEF ; } -static int tcpm_ams_finish (struct tcpm_port *port) +static void tcpm_ams_finish (struct tcpm_port *port) { -int ret =0 ; -tcpm_log (port,"AMS %s finished" , tcpm_ams_str[port->ams]);if (port->pd_capable && port->pwr_role ==TYPEC_SOURCE ) {
@@ -790,8 +788,6 @@ static int tcpm_ams_finish(struct tcpm_port *port) port->in_ams = false; port->ams =NONE_AMS ; - -return ret; } static int tcpm_pd_transmit(struct tcpm_port *port,
Signature · 1 line
1.8.3.1
Quoted 9 lines · Yang Li
This function always return '0' and no callers use the return value. So make it a void function.
This eliminates the following coccicheck warning:
./drivers/usb/typec/tcpm/tcpm.c:778:5-8: Unneeded variable: "ret". Return "0" on line 794Reported-by Abaci Robot <[email protected]>Signed-off-by Yang Li <[email protected]>
Quoted 35 lines
---
Change in v2:
(quoted diff) +0
-1-remove the unnecessary return statement drivers/usb/typec/tcpm/tcpm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/usb/typec/tcpm/tcpm.c +1
-5@@ -773,10 +773,8 @@ static enum typec_cc_status tcpm_rp_cc(struct tcpm_port *port)return TYPEC_CC_RP_DEF ; } -static int tcpm_ams_finish (struct tcpm_port *port) +static void tcpm_ams_finish (struct tcpm_port *port) { -int ret =0 ; -tcpm_log (port,"AMS %s finished" , tcpm_ams_str[port->ams]);if (port->pd_capable && port->pwr_role ==TYPEC_SOURCE ) {@@ -790,8 +788,6 @@ static int tcpm_ams_finish(struct tcpm_port *port) port->in_ams = false; port->ams =NONE_AMS ; - -return ret; } static int tcpm_pd_transmit(struct tcpm_port *port,Signature · 1 line
1.8.3.1
Signature · 1 line
heikki
Quoted 9 lines · Yang Li
This function always return '0' and no callers use the return value. So make it a void function.
This eliminates the following coccicheck warning:
./drivers/usb/typec/tcpm/tcpm.c:778:5-8: Unneeded variable: "ret". Return "0" on line 794Reported-by Abaci Robot <[email protected]>Signed-off-by Yang Li <[email protected]>
Quoted 36 lines
---
Change in v2:
(quoted diff) +0
-1-remove the unnecessary return statement drivers/usb/typec/tcpm/tcpm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/usb/typec/tcpm/tcpm.c +1
-5@@ -773,10 +773,8 @@ static enum typec_cc_status tcpm_rp_cc(struct tcpm_port *port)return TYPEC_CC_RP_DEF ; } -static int tcpm_ams_finish (struct tcpm_port *port) +static void tcpm_ams_finish (struct tcpm_port *port) { -int ret =0 ; -tcpm_log (port,"AMS %s finished" , tcpm_ams_str[port->ams]);if (port->pd_capable && port->pwr_role ==TYPEC_SOURCE ) {@@ -790,8 +788,6 @@ static int tcpm_ams_finish(struct tcpm_port *port) port->in_ams = false; port->ams =NONE_AMS ; - -return ret; } static int tcpm_pd_transmit(struct tcpm_port *port,Signature · 1 line
1.8.3.1