All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] net: qed: remove unneeded return variables
@ 2021-07-26 12:21 Shai Malin
  0 siblings, 0 replies; 3+ messages in thread
From: Shai Malin @ 2021-07-26 12:21 UTC (permalink / raw)
  To: Jason Wang
  Cc: Ariel Elior, GR-everest-linux-l2, davem, kuba, netdev, linux-kernel

On Sunday, July 25, 2021 6:14 PM, Jason Wang <wangborong@cdjrlc.com> wrote:
> Some return variables are never changed until function returned.
> These variables are unneeded for their functions. Therefore, the unneeded
> return variables can be removed safely by returning their initial values.
> 
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
> ---
>  drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> index e81dd34a3cac..dc93ddea8906 100644
> --- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> +++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
> @@ -741,7 +741,6 @@ static int
>  qed_dcbx_read_local_lldp_mib(struct qed_hwfn *p_hwfn, struct qed_ptt
> *p_ptt)  {
>  	struct qed_dcbx_mib_meta_data data;
> -	int rc = 0;
> 
>  	memset(&data, 0, sizeof(data));
>  	data.addr = p_hwfn->mcp_info->port_addr + offsetof(struct
> public_port, @@ -750,7 +749,7 @@ qed_dcbx_read_local_lldp_mib(struct
> qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
>  	data.size = sizeof(struct lldp_config_params_s);
>  	qed_memcpy_from(p_hwfn, p_ptt, data.lldp_local, data.addr,
> data.size);
> 
> -	return rc;
> +	return 0;
>  }
> 
>  static int
> @@ -810,7 +809,6 @@ static int
>  qed_dcbx_read_local_mib(struct qed_hwfn *p_hwfn, struct qed_ptt
> *p_ptt)  {
>  	struct qed_dcbx_mib_meta_data data;
> -	int rc = 0;
> 
>  	memset(&data, 0, sizeof(data));
>  	data.addr = p_hwfn->mcp_info->port_addr + @@ -819,7 +817,7 @@
> qed_dcbx_read_local_mib(struct qed_hwfn *p_hwfn, struct qed_ptt
> *p_ptt)
>  	data.size = sizeof(struct dcbx_local_params);
>  	qed_memcpy_from(p_hwfn, p_ptt, data.local_admin, data.addr,
> data.size);
> 
> -	return rc;
> +	return 0;
>  }
> 
>  static int qed_dcbx_read_mib(struct qed_hwfn *p_hwfn,
> --
> 2.32.0

Thanks!

Acked-by: Shai Malin <smalin@marvell.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: qed: remove unneeded return variables
  2021-07-25 15:13 Jason Wang
@ 2021-07-27 11:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-27 11:00 UTC (permalink / raw)
  To: Jason Wang; +Cc: aelior, GR-everest-linux-l2, davem, kuba, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Sun, 25 Jul 2021 23:13:53 +0800 you wrote:
> Some return variables are never changed until function returned.
> These variables are unneeded for their functions. Therefore, the
> unneeded return variables can be removed safely by returning their
> initial values.
> 
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
> 
> [...]

Here is the summary with links:
  - net: qed: remove unneeded return variables
    https://git.kernel.org/netdev/net-next/c/ef17e2ac2183

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] net: qed: remove unneeded return variables
@ 2021-07-25 15:13 Jason Wang
  2021-07-27 11:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Wang @ 2021-07-25 15:13 UTC (permalink / raw)
  To: aelior; +Cc: GR-everest-linux-l2, davem, kuba, netdev, linux-kernel, Jason Wang

Some return variables are never changed until function returned.
These variables are unneeded for their functions. Therefore, the
unneeded return variables can be removed safely by returning their
initial values.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
---
 drivers/net/ethernet/qlogic/qed/qed_dcbx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
index e81dd34a3cac..dc93ddea8906 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dcbx.c
@@ -741,7 +741,6 @@ static int
 qed_dcbx_read_local_lldp_mib(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
 {
 	struct qed_dcbx_mib_meta_data data;
-	int rc = 0;
 
 	memset(&data, 0, sizeof(data));
 	data.addr = p_hwfn->mcp_info->port_addr + offsetof(struct public_port,
@@ -750,7 +749,7 @@ qed_dcbx_read_local_lldp_mib(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
 	data.size = sizeof(struct lldp_config_params_s);
 	qed_memcpy_from(p_hwfn, p_ptt, data.lldp_local, data.addr, data.size);
 
-	return rc;
+	return 0;
 }
 
 static int
@@ -810,7 +809,6 @@ static int
 qed_dcbx_read_local_mib(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
 {
 	struct qed_dcbx_mib_meta_data data;
-	int rc = 0;
 
 	memset(&data, 0, sizeof(data));
 	data.addr = p_hwfn->mcp_info->port_addr +
@@ -819,7 +817,7 @@ qed_dcbx_read_local_mib(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
 	data.size = sizeof(struct dcbx_local_params);
 	qed_memcpy_from(p_hwfn, p_ptt, data.local_admin, data.addr, data.size);
 
-	return rc;
+	return 0;
 }
 
 static int qed_dcbx_read_mib(struct qed_hwfn *p_hwfn,
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-27 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26 12:21 [PATCH] net: qed: remove unneeded return variables Shai Malin
  -- strict thread matches above, loose matches on Subject: below --
2021-07-25 15:13 Jason Wang
2021-07-27 11:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.