diff mbox series

sfc/ef10: remove unneeded rc variable

Message ID 20220118075616.925855-1-chi.minghao@zte.com.cn (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series sfc/ef10: remove unneeded rc variable | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

CGEL Jan. 18, 2022, 7:56 a.m. UTC
From: Minghao Chi <chi.minghao@zte.com.cn>

Return value from efx_mcdi_rpc() directly instead
of taking this in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
---
 drivers/net/ethernet/sfc/ef10.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Martin Habets Jan. 19, 2022, 8:26 a.m. UTC | #1
On Tue, Jan 18, 2022 at 07:56:16AM +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Return value from efx_mcdi_rpc() directly instead
> of taking this in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
> ---
>  drivers/net/ethernet/sfc/ef10.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
> index cf366ed2557c..991758292b7c 100644
> --- a/drivers/net/ethernet/sfc/ef10.c
> +++ b/drivers/net/ethernet/sfc/ef10.c
> @@ -3627,7 +3627,6 @@ static int efx_ef10_rx_disable_timestamping(struct efx_channel *channel,
>  					    bool temp)
>  {
>  	MCDI_DECLARE_BUF(inbuf, MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_LEN);
> -	int rc;
>  
>  	if (channel->sync_events_state == SYNC_EVENTS_DISABLED ||
>  	    (temp && channel->sync_events_state == SYNC_EVENTS_QUIESCENT))
> @@ -3646,10 +3645,8 @@ static int efx_ef10_rx_disable_timestamping(struct efx_channel *channel,
>  	MCDI_SET_DWORD(inbuf, PTP_IN_TIME_EVENT_UNSUBSCRIBE_QUEUE,
>  		       channel->channel);
>  
> -	rc = efx_mcdi_rpc(channel->efx, MC_CMD_PTP,
> +	return efx_mcdi_rpc(channel->efx, MC_CMD_PTP,
>  			  inbuf, sizeof(inbuf), NULL, 0, NULL);

Looks good, but indent the continuation line to align with the ( above
it.

This sort of cleanup is for net-next, which is closed at the moment.
See https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt

Martin

> -
> -	return rc;
>  }
>  
>  static int efx_ef10_ptp_set_ts_sync_events(struct efx_nic *efx, bool en,
> -- 
> 2.25.1
diff mbox series

Patch

diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index cf366ed2557c..991758292b7c 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -3627,7 +3627,6 @@  static int efx_ef10_rx_disable_timestamping(struct efx_channel *channel,
 					    bool temp)
 {
 	MCDI_DECLARE_BUF(inbuf, MC_CMD_PTP_IN_TIME_EVENT_UNSUBSCRIBE_LEN);
-	int rc;
 
 	if (channel->sync_events_state == SYNC_EVENTS_DISABLED ||
 	    (temp && channel->sync_events_state == SYNC_EVENTS_QUIESCENT))
@@ -3646,10 +3645,8 @@  static int efx_ef10_rx_disable_timestamping(struct efx_channel *channel,
 	MCDI_SET_DWORD(inbuf, PTP_IN_TIME_EVENT_UNSUBSCRIBE_QUEUE,
 		       channel->channel);
 
-	rc = efx_mcdi_rpc(channel->efx, MC_CMD_PTP,
+	return efx_mcdi_rpc(channel->efx, MC_CMD_PTP,
 			  inbuf, sizeof(inbuf), NULL, 0, NULL);
-
-	return rc;
 }
 
 static int efx_ef10_ptp_set_ts_sync_events(struct efx_nic *efx, bool en,