* [PATCH] MIPS: Octeon: remove unneeded variable
[not found] <20230614023829.23752-1-luojianhong@cdjrlc.com>
@ 2023-06-14 2:40 ` baomingtong001
2023-06-14 14:47 ` Maciej W. Rozycki
0 siblings, 1 reply; 3+ messages in thread
From: baomingtong001 @ 2023-06-14 2:40 UTC (permalink / raw)
To: tsbogend; +Cc: linux-mips, linux-kernel
fix the following coccicheck warning:
arch/mips/cavium-octeon/executive/cvmx-spi.c:152:5-8: Unneeded variable:
"res".
Signed-off-by: Mingtong Bao <baomingtong001@208suo.com>
---
arch/mips/cavium-octeon/executive/cvmx-spi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/mips/cavium-octeon/executive/cvmx-spi.c
b/arch/mips/cavium-octeon/executive/cvmx-spi.c
index eb9333e84a6b..1f8b85473677 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-spi.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-spi.c
@@ -149,10 +149,9 @@ int cvmx_spi_start_interface(int interface,
cvmx_spi_mode_t mode, int timeout,
*/
int cvmx_spi_restart_interface(int interface, cvmx_spi_mode_t mode, int
timeout)
{
- int res = -1;
if (!(OCTEON_IS_MODEL(OCTEON_CN38XX) ||
OCTEON_IS_MODEL(OCTEON_CN58XX)))
- return res;
+ return -1;
cvmx_dprintf("SPI%d: Restart %s\n", interface, modes[mode]);
@@ -175,7 +174,7 @@ int cvmx_spi_restart_interface(int interface,
cvmx_spi_mode_t mode, int timeout)
/* Callback to handle interface coming up */
INVOKE_CB(cvmx_spi_callbacks.interface_up_cb, interface, mode);
- return res;
+ return -1;
}
EXPORT_SYMBOL_GPL(cvmx_spi_restart_interface);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] MIPS: Octeon: remove unneeded variable
2023-06-14 2:40 ` [PATCH] MIPS: Octeon: remove unneeded variable baomingtong001
@ 2023-06-14 14:47 ` Maciej W. Rozycki
0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2023-06-14 14:47 UTC (permalink / raw)
To: baomingtong001; +Cc: Thomas Bogendoerfer, linux-mips, linux-kernel
On Wed, 14 Jun 2023, baomingtong001@208suo.com wrote:
> fix the following coccicheck warning:
>
> arch/mips/cavium-octeon/executive/cvmx-spi.c:152:5-8: Unneeded variable:
> "res".
Have you actually tried to rebuild with your "fix" applied? Please
always do before submitting patches.
Maciej
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] MIPS: Octeon: remove unneeded variable
[not found] <20230614024408.46240-1-luojianhong@cdjrlc.com>
@ 2023-06-14 2:51 ` baomingtong001
0 siblings, 0 replies; 3+ messages in thread
From: baomingtong001 @ 2023-06-14 2:51 UTC (permalink / raw)
To: tsbogend; +Cc: linux-mips, linux-kernel
fix the following coccicheck warning:
arch/mips/cavium-octeon/executive/cvmx-spi.c:108:5-8: Unneeded variable:
"res".
Signed-off-by: Mingtong Bao <baomingtong001@208suo.com>
---
arch/mips/cavium-octeon/executive/cvmx-spi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/mips/cavium-octeon/executive/cvmx-spi.c
b/arch/mips/cavium-octeon/executive/cvmx-spi.c
index 1f8b85473677..5906cc551f75 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-spi.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-spi.c
@@ -105,10 +105,9 @@ void cvmx_spi_set_callbacks(cvmx_spi_callbacks_t
*new_callbacks)
int cvmx_spi_start_interface(int interface, cvmx_spi_mode_t mode, int
timeout,
int num_ports)
{
- int res = -1;
if (!(OCTEON_IS_MODEL(OCTEON_CN38XX) ||
OCTEON_IS_MODEL(OCTEON_CN58XX)))
- return res;
+ return -1;
/* Callback to perform SPI4 reset */
INVOKE_CB(cvmx_spi_callbacks.reset_cb, interface, mode);
@@ -130,7 +129,7 @@ int cvmx_spi_start_interface(int interface,
cvmx_spi_mode_t mode, int timeout,
/* Callback to handle interface coming up */
INVOKE_CB(cvmx_spi_callbacks.interface_up_cb, interface, mode);
- return res;
+ return -1;
}
/*
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-14 14:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230614023829.23752-1-luojianhong@cdjrlc.com>
2023-06-14 2:40 ` [PATCH] MIPS: Octeon: remove unneeded variable baomingtong001
2023-06-14 14:47 ` Maciej W. Rozycki
[not found] <20230614024408.46240-1-luojianhong@cdjrlc.com>
2023-06-14 2:51 ` baomingtong001
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).