All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mips/pci: remove redundant ret variable
@ 2022-01-04 11:20 cgel.zte
  2022-01-05  8:54 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-01-04 11:20 UTC (permalink / raw)
  To: tsbogend
  Cc: maz, ilya.lipnitskiy, chi.minghao, ryazanov.s.a, linux-mips,
	linux-kernel, Zeal Robot, CGEL ZTE

From: Minghao Chi <chi.minghao@zte.com.cn>

Return value from rt3883_pci_r32() 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>
---
 arch/mips/pci/pci-rt3883.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/mips/pci/pci-rt3883.c b/arch/mips/pci/pci-rt3883.c
index d3c947fa2969..e07ae098bdd8 100644
--- a/arch/mips/pci/pci-rt3883.c
+++ b/arch/mips/pci/pci-rt3883.c
@@ -102,14 +102,12 @@ static u32 rt3883_pci_read_cfg32(struct rt3883_pci_controller *rpc,
 			       unsigned func, unsigned reg)
 {
 	u32 address;
-	u32 ret;
 
 	address = rt3883_pci_get_cfgaddr(bus, slot, func, reg);
 
 	rt3883_pci_w32(rpc, address, RT3883_PCI_REG_CFGADDR);
-	ret = rt3883_pci_r32(rpc, RT3883_PCI_REG_CFGDATA);
 
-	return ret;
+	return rt3883_pci_r32(rpc, RT3883_PCI_REG_CFGDATA);
 }
 
 static void rt3883_pci_write_cfg32(struct rt3883_pci_controller *rpc,
-- 
2.25.1


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

* Re: [PATCH] mips/pci: remove redundant ret variable
  2022-01-04 11:20 [PATCH] mips/pci: remove redundant ret variable cgel.zte
@ 2022-01-05  8:54 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2022-01-05  8:54 UTC (permalink / raw)
  To: cgel.zte
  Cc: maz, ilya.lipnitskiy, chi.minghao, ryazanov.s.a, linux-mips,
	linux-kernel, Zeal Robot

On Tue, Jan 04, 2022 at 11:20:24AM +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> Return value from rt3883_pci_r32() 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>
> ---
>  arch/mips/pci/pci-rt3883.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/mips/pci/pci-rt3883.c b/arch/mips/pci/pci-rt3883.c
> index d3c947fa2969..e07ae098bdd8 100644
> --- a/arch/mips/pci/pci-rt3883.c
> +++ b/arch/mips/pci/pci-rt3883.c
> @@ -102,14 +102,12 @@ static u32 rt3883_pci_read_cfg32(struct rt3883_pci_controller *rpc,
>  			       unsigned func, unsigned reg)
>  {
>  	u32 address;
> -	u32 ret;
>  
>  	address = rt3883_pci_get_cfgaddr(bus, slot, func, reg);
>  
>  	rt3883_pci_w32(rpc, address, RT3883_PCI_REG_CFGADDR);
> -	ret = rt3883_pci_r32(rpc, RT3883_PCI_REG_CFGDATA);
>  
> -	return ret;
> +	return rt3883_pci_r32(rpc, RT3883_PCI_REG_CFGDATA);
>  }
>  
>  static void rt3883_pci_write_cfg32(struct rt3883_pci_controller *rpc,
> -- 
> 2.25.1

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2022-01-05  9:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 11:20 [PATCH] mips/pci: remove redundant ret variable cgel.zte
2022-01-05  8:54 ` Thomas Bogendoerfer

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.