Skip to contentSkip to conversation

sfc/ef10: remove unneeded rc variable

PATCH In review [email protected] 2 participants 2 messages Jan 18, 2022 – Jan 19, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sfc/ef10: remove unneeded rc variable

From: Minghao Chi <[email protected]>

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

---
 drivers/net/ethernet/sfc/ef10.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/sfc/ef10.c +1 -4
index cf366ed2557c..991758292b7c 100644
@@ -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,
Signature · 1 line
2.25.1
#1 lore raw
Quoted 25 lines · On Tue, Jan 18, 2022 at 07:56:16AM +0000, [email protected] wrote:

From: Minghao Chi <[email protected]>

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

---
 drivers/net/ethernet/sfc/ef10.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/sfc/ef10.c +0 -1
index cf366ed2557c..991758292b7c 100644
@@ -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))

drivers/net/ethernet/sfc/ef10.c static int efx_ef10_rx_disable_timestamping(struct efx_channel *channel, · line 3649

Quoted 6 lines
drivers/net/ethernet/sfc/ef10.c +1 -1
@@ -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

Quoted 7 lines
drivers/net/ethernet/sfc/ef10.c +0 -2
-
-	return rc;
 }
 
 static int efx_ef10_ptp_set_ts_sync_events(struct efx_nic *efx, bool en,
Signature · 1 line
2.25.1