public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: octeon: Remove unneeded variable
@ 2019-10-26 22:24 Cristiane Naves
  2019-10-28  8:27 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Cristiane Naves @ 2019-10-26 22:24 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Greg Kroah-Hartman, Julia Lawall, devel, linux-kernel

Remove unneeded variable used to store return value. Issue found by
coccicheck.

Signed-off-by: Cristiane Naves <cristianenavescardoso09@gmail.com>
---
 drivers/staging/octeon/octeon-stubs.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
index b07f5e2..d53bd801 100644
--- a/drivers/staging/octeon/octeon-stubs.h
+++ b/drivers/staging/octeon/octeon-stubs.h
@@ -1387,9 +1387,7 @@ static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(uint64_t port,
 		uint64_t queue, union cvmx_pko_command_word0 pko_command,
 		union cvmx_buf_ptr packet, cvmx_pko_lock_t use_locking)
 {
-	cvmx_pko_status_t ret = 0;
-
-	return ret;
+	return 0;
 }
 
 static inline void cvmx_wqe_set_port(struct cvmx_wqe *work, int port)
-- 
2.7.4


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

* Re: [PATCH] staging: octeon: Remove unneeded variable
  2019-10-26 22:24 [PATCH] staging: octeon: Remove unneeded variable Cristiane Naves
@ 2019-10-28  8:27 ` Dan Carpenter
  2019-10-28  8:36   ` Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2019-10-28  8:27 UTC (permalink / raw)
  To: Cristiane Naves
  Cc: outreachy-kernel, devel, Greg Kroah-Hartman, linux-kernel,
	Julia Lawall

On Sat, Oct 26, 2019 at 07:24:53PM -0300, Cristiane Naves wrote:
> Remove unneeded variable used to store return value. Issue found by
> coccicheck.
> 
> Signed-off-by: Cristiane Naves <cristianenavescardoso09@gmail.com>
> ---
>  drivers/staging/octeon/octeon-stubs.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
> index b07f5e2..d53bd801 100644
> --- a/drivers/staging/octeon/octeon-stubs.h
> +++ b/drivers/staging/octeon/octeon-stubs.h
> @@ -1387,9 +1387,7 @@ static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(uint64_t port,
>  		uint64_t queue, union cvmx_pko_command_word0 pko_command,
>  		union cvmx_buf_ptr packet, cvmx_pko_lock_t use_locking)
>  {
> -	cvmx_pko_status_t ret = 0;
> -
> -	return ret;
> +	return 0;

What is the point of this function anyway?

regards,
dan carpenter


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

* Re: [PATCH] staging: octeon: Remove unneeded variable
  2019-10-28  8:27 ` Dan Carpenter
@ 2019-10-28  8:36   ` Julia Lawall
  2019-10-28  8:40     ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2019-10-28  8:36 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Cristiane Naves, outreachy-kernel, devel, Greg Kroah-Hartman,
	linux-kernel



On Mon, 28 Oct 2019, Dan Carpenter wrote:

> On Sat, Oct 26, 2019 at 07:24:53PM -0300, Cristiane Naves wrote:
> > Remove unneeded variable used to store return value. Issue found by
> > coccicheck.
> >
> > Signed-off-by: Cristiane Naves <cristianenavescardoso09@gmail.com>
> > ---
> >  drivers/staging/octeon/octeon-stubs.h | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
> > index b07f5e2..d53bd801 100644
> > --- a/drivers/staging/octeon/octeon-stubs.h
> > +++ b/drivers/staging/octeon/octeon-stubs.h
> > @@ -1387,9 +1387,7 @@ static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(uint64_t port,
> >  		uint64_t queue, union cvmx_pko_command_word0 pko_command,
> >  		union cvmx_buf_ptr packet, cvmx_pko_lock_t use_locking)
> >  {
> > -	cvmx_pko_status_t ret = 0;
> > -
> > -	return ret;
> > +	return 0;
>
> What is the point of this function anyway?

Given that it is in octeon-stubs.h, it seems that the point is to get the
code to compile when COMPILE_TEST is set.  There is a real definition in
arch/mips/include/asm/octeon/cvmx-pko.h

julia

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

* Re: [PATCH] staging: octeon: Remove unneeded variable
  2019-10-28  8:36   ` Julia Lawall
@ 2019-10-28  8:40     ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2019-10-28  8:40 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Cristiane Naves, outreachy-kernel, devel, Greg Kroah-Hartman,
	linux-kernel

On Mon, Oct 28, 2019 at 09:36:04AM +0100, Julia Lawall wrote:
> 
> 
> On Mon, 28 Oct 2019, Dan Carpenter wrote:
> 
> > On Sat, Oct 26, 2019 at 07:24:53PM -0300, Cristiane Naves wrote:
> > > Remove unneeded variable used to store return value. Issue found by
> > > coccicheck.
> > >
> > > Signed-off-by: Cristiane Naves <cristianenavescardoso09@gmail.com>
> > > ---
> > >  drivers/staging/octeon/octeon-stubs.h | 4 +---
> > >  1 file changed, 1 insertion(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/staging/octeon/octeon-stubs.h b/drivers/staging/octeon/octeon-stubs.h
> > > index b07f5e2..d53bd801 100644
> > > --- a/drivers/staging/octeon/octeon-stubs.h
> > > +++ b/drivers/staging/octeon/octeon-stubs.h
> > > @@ -1387,9 +1387,7 @@ static inline cvmx_pko_status_t cvmx_pko_send_packet_finish(uint64_t port,
> > >  		uint64_t queue, union cvmx_pko_command_word0 pko_command,
> > >  		union cvmx_buf_ptr packet, cvmx_pko_lock_t use_locking)
> > >  {
> > > -	cvmx_pko_status_t ret = 0;
> > > -
> > > -	return ret;
> > > +	return 0;
> >
> > What is the point of this function anyway?
> 
> Given that it is in octeon-stubs.h, it seems that the point is to get the
> code to compile when COMPILE_TEST is set.  There is a real definition in
> arch/mips/include/asm/octeon/cvmx-pko.h

Oh yeah...  Duh.  I saw that it was in stubs but I just assumed that it
was stubs for something which was never implemented or left over code...

My bad.

regards,
dan carpente


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

end of thread, other threads:[~2019-10-28  8:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-26 22:24 [PATCH] staging: octeon: Remove unneeded variable Cristiane Naves
2019-10-28  8:27 ` Dan Carpenter
2019-10-28  8:36   ` Julia Lawall
2019-10-28  8:40     ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox