Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1265032 > unrolled thread

[PATCH] dma: fix returnvar.cocci warnings

Started byJulia Lawall <julia.lawall@lip6.fr>
First post2015-11-08 08:50 +0100
Last post2015-11-08 23:10 +0100
Articles 7 — 5 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] dma: fix returnvar.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2015-11-08 08:50 +0100
    Re: [PATCH] dma: fix returnvar.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2015-11-08 22:20 +0100
    Re: [PATCH] dma: fix returnvar.cocci warnings Julia Lawall <julia.lawall@lip6.fr> - 2015-11-08 22:20 +0100
    Re: [PATCH] dma: fix returnvar.cocci warnings Timur Tabi <timur@codeaurora.org> - 2015-11-08 22:20 +0100
    Re: [PATCH] dma: fix returnvar.cocci warnings Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-08 22:20 +0100
    Re: [PATCH] dma: fix returnvar.cocci warnings "Daniel K." <dk@syse.no> - 2015-11-08 23:00 +0100
      Re: [PATCH] dma: fix returnvar.cocci warnings Sinan Kaya <okaya@codeaurora.org> - 2015-11-08 23:10 +0100

#1265032 — [PATCH] dma: fix returnvar.cocci warnings

FromJulia Lawall <julia.lawall@lip6.fr>
Date2015-11-08 08:50 +0100
Subject[PATCH] dma: fix returnvar.cocci warnings
Message-ID<qssTD-5Ef-5@gated-at.bofh.it>
 Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

CC: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 hidma_ll.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/drivers/dma/qcom/hidma_ll.c
+++ b/drivers/dma/qcom/hidma_ll.c
@@ -567,14 +567,13 @@ int hidma_ll_resume(struct hidma_lldev *

 static int hidma_ll_hw_start(struct hidma_lldev *lldev)
 {
-	int rc = 0;
 	unsigned long irqflags;

 	spin_lock_irqsave(&lldev->lock, irqflags);
 	writel(lldev->tre_write_offset, lldev->trca + TRCA_DOORBELL_OFFSET);
 	spin_unlock_irqrestore(&lldev->lock, irqflags);

-	return rc;
+	return 0;
 }

 bool hidma_ll_isenabled(struct hidma_lldev *lldev)
@@ -600,7 +599,6 @@ bool hidma_ll_isenabled(struct hidma_lld
 int hidma_ll_queue_request(struct hidma_lldev *lldev, u32 tre_ch)
 {
 	struct hidma_tre *tre;
-	int rc = 0;
 	unsigned long flags;

 	tre = &lldev->trepool[tre_ch];
@@ -618,7 +616,7 @@ int hidma_ll_queue_request(struct hidma_
 	lldev->tre_write_offset = (lldev->tre_write_offset + TRE_SIZE)
 				% lldev->tre_ring_size;
 	spin_unlock_irqrestore(&lldev->lock, flags);
-	return rc;
+	return 0;
 }

 int hidma_ll_start(struct hidma_lldev *lldev)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1265194

FromJulia Lawall <julia.lawall@lip6.fr>
Date2015-11-08 22:20 +0100
Message-ID<qsFxv-5qj-7@gated-at.bofh.it>
In reply to#1265032

On Sun, 8 Nov 2015, Andy Shevchenko wrote:

> On Sun, Nov 8, 2015 at 9:45 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >  Remove unneeded variable used to store return value.
> >
> > Generated by: scripts/coccinelle/misc/returnvar.cocci
> >
> > CC: Sinan Kaya <okaya@codeaurora.org>
> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>

Sorry for the oversight.

julia

>
> Who is the author?
> I suppose Fengguang is the reporter, right?
>
> > ---
> >
> >  hidma_ll.c |    6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > --- a/drivers/dma/qcom/hidma_ll.c
> > +++ b/drivers/dma/qcom/hidma_ll.c
> > @@ -567,14 +567,13 @@ int hidma_ll_resume(struct hidma_lldev *
> >
> >  static int hidma_ll_hw_start(struct hidma_lldev *lldev)
> >  {
> > -       int rc = 0;
> >         unsigned long irqflags;
> >
> >         spin_lock_irqsave(&lldev->lock, irqflags);
> >         writel(lldev->tre_write_offset, lldev->trca + TRCA_DOORBELL_OFFSET);
> >         spin_unlock_irqrestore(&lldev->lock, irqflags);
> >
> > -       return rc;
> > +       return 0;
> >  }
> >
> >  bool hidma_ll_isenabled(struct hidma_lldev *lldev)
> > @@ -600,7 +599,6 @@ bool hidma_ll_isenabled(struct hidma_lld
> >  int hidma_ll_queue_request(struct hidma_lldev *lldev, u32 tre_ch)
> >  {
> >         struct hidma_tre *tre;
> > -       int rc = 0;
> >         unsigned long flags;
> >
> >         tre = &lldev->trepool[tre_ch];
> > @@ -618,7 +616,7 @@ int hidma_ll_queue_request(struct hidma_
> >         lldev->tre_write_offset = (lldev->tre_write_offset + TRE_SIZE)
> >                                 % lldev->tre_ring_size;
> >         spin_unlock_irqrestore(&lldev->lock, flags);
> > -       return rc;
> > +       return 0;
> >  }
> >
> >  int hidma_ll_start(struct hidma_lldev *lldev)
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
>
>
>
> --
> With Best Regards,
> Andy Shevchenko
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265195

FromJulia Lawall <julia.lawall@lip6.fr>
Date2015-11-08 22:20 +0100
Message-ID<qsFxw-5qj-11@gated-at.bofh.it>
In reply to#1265032

On Sun, 8 Nov 2015, Andy Shevchenko wrote:

> On Sun, Nov 8, 2015 at 9:45 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >  Remove unneeded variable used to store return value.
> >
> > Generated by: scripts/coccinelle/misc/returnvar.cocci
> >
> > CC: Sinan Kaya <okaya@codeaurora.org>
> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
>
> Who is the author?
> I suppose Fengguang is the reporter, right?

There is no human author...  But normally when I check these I add a
signed off by line to them.

julia

>
> > ---
> >
> >  hidma_ll.c |    6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > --- a/drivers/dma/qcom/hidma_ll.c
> > +++ b/drivers/dma/qcom/hidma_ll.c
> > @@ -567,14 +567,13 @@ int hidma_ll_resume(struct hidma_lldev *
> >
> >  static int hidma_ll_hw_start(struct hidma_lldev *lldev)
> >  {
> > -       int rc = 0;
> >         unsigned long irqflags;
> >
> >         spin_lock_irqsave(&lldev->lock, irqflags);
> >         writel(lldev->tre_write_offset, lldev->trca + TRCA_DOORBELL_OFFSET);
> >         spin_unlock_irqrestore(&lldev->lock, irqflags);
> >
> > -       return rc;
> > +       return 0;
> >  }
> >
> >  bool hidma_ll_isenabled(struct hidma_lldev *lldev)
> > @@ -600,7 +599,6 @@ bool hidma_ll_isenabled(struct hidma_lld
> >  int hidma_ll_queue_request(struct hidma_lldev *lldev, u32 tre_ch)
> >  {
> >         struct hidma_tre *tre;
> > -       int rc = 0;
> >         unsigned long flags;
> >
> >         tre = &lldev->trepool[tre_ch];
> > @@ -618,7 +616,7 @@ int hidma_ll_queue_request(struct hidma_
> >         lldev->tre_write_offset = (lldev->tre_write_offset + TRE_SIZE)
> >                                 % lldev->tre_ring_size;
> >         spin_unlock_irqrestore(&lldev->lock, flags);
> > -       return rc;
> > +       return 0;
> >  }
> >
> >  int hidma_ll_start(struct hidma_lldev *lldev)
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
>
>
>
> --
> With Best Regards,
> Andy Shevchenko
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265196

FromTimur Tabi <timur@codeaurora.org>
Date2015-11-08 22:20 +0100
Message-ID<qsFxw-5qj-13@gated-at.bofh.it>
In reply to#1265032
Andy Shevchenko wrote:
>> >CC: Sinan Kaya<okaya@codeaurora.org>
>> >Signed-off-by: Fengguang Wu<fengguang.wu@intel.com>
> Who is the author?
> I suppose Fengguang is the reporter, right?
>

These are Julia Lawall's coccinelle scripts that automatically run on 
patches and report problems.  Just treat them like normal code reviews 
and incorporate the change in the next version of your patch.

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265197

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2015-11-08 22:20 +0100
Message-ID<qsFxv-5qj-9@gated-at.bofh.it>
In reply to#1265032
On Sun, Nov 8, 2015 at 9:45 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>  Remove unneeded variable used to store return value.
>
> Generated by: scripts/coccinelle/misc/returnvar.cocci
>
> CC: Sinan Kaya <okaya@codeaurora.org>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Who is the author?
I suppose Fengguang is the reporter, right?

> ---
>
>  hidma_ll.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> --- a/drivers/dma/qcom/hidma_ll.c
> +++ b/drivers/dma/qcom/hidma_ll.c
> @@ -567,14 +567,13 @@ int hidma_ll_resume(struct hidma_lldev *
>
>  static int hidma_ll_hw_start(struct hidma_lldev *lldev)
>  {
> -       int rc = 0;
>         unsigned long irqflags;
>
>         spin_lock_irqsave(&lldev->lock, irqflags);
>         writel(lldev->tre_write_offset, lldev->trca + TRCA_DOORBELL_OFFSET);
>         spin_unlock_irqrestore(&lldev->lock, irqflags);
>
> -       return rc;
> +       return 0;
>  }
>
>  bool hidma_ll_isenabled(struct hidma_lldev *lldev)
> @@ -600,7 +599,6 @@ bool hidma_ll_isenabled(struct hidma_lld
>  int hidma_ll_queue_request(struct hidma_lldev *lldev, u32 tre_ch)
>  {
>         struct hidma_tre *tre;
> -       int rc = 0;
>         unsigned long flags;
>
>         tre = &lldev->trepool[tre_ch];
> @@ -618,7 +616,7 @@ int hidma_ll_queue_request(struct hidma_
>         lldev->tre_write_offset = (lldev->tre_write_offset + TRE_SIZE)
>                                 % lldev->tre_ring_size;
>         spin_unlock_irqrestore(&lldev->lock, flags);
> -       return rc;
> +       return 0;
>  }
>
>  int hidma_ll_start(struct hidma_lldev *lldev)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265210

From"Daniel K." <dk@syse.no>
Date2015-11-08 23:00 +0100
Message-ID<qsGae-5DX-19@gated-at.bofh.it>
In reply to#1265032
On 11/08/2015 07:45 AM, Julia Lawall wrote:
>  Remove unneeded variable used to store return value.
> 
> --- a/drivers/dma/qcom/hidma_ll.c
> +++ b/drivers/dma/qcom/hidma_ll.c
> @@ -567,14 +567,13 @@ int hidma_ll_resume(struct hidma_lldev *
> 
>  static int hidma_ll_hw_start(struct hidma_lldev *lldev)
>  {
> -	int rc = 0;
>  	unsigned long irqflags;
> 
>  	spin_lock_irqsave(&lldev->lock, irqflags);
>  	writel(lldev->tre_write_offset, lldev->trca + TRCA_DOORBELL_OFFSET);
>  	spin_unlock_irqrestore(&lldev->lock, irqflags);
> 
> -	return rc;
> +	return 0;
>  }
> 
>  bool hidma_ll_isenabled(struct hidma_lldev *lldev)

Seems rather pointless, what about 'static void ...' and dropping the
return statement?


Daniel K.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1265215

FromSinan Kaya <okaya@codeaurora.org>
Date2015-11-08 23:10 +0100
Message-ID<qsGjU-5WC-11@gated-at.bofh.it>
In reply to#1265210

On 11/8/2015 4:39 PM, Daniel K. wrote:
> On 11/08/2015 07:45 AM, Julia Lawall wrote:
>>   Remove unneeded variable used to store return value.
>>
>> --- a/drivers/dma/qcom/hidma_ll.c
>> +++ b/drivers/dma/qcom/hidma_ll.c
>> @@ -567,14 +567,13 @@ int hidma_ll_resume(struct hidma_lldev *
>>
>>   static int hidma_ll_hw_start(struct hidma_lldev *lldev)
>>   {
>> -	int rc = 0;
>>   	unsigned long irqflags;
>>
>>   	spin_lock_irqsave(&lldev->lock, irqflags);
>>   	writel(lldev->tre_write_offset, lldev->trca + TRCA_DOORBELL_OFFSET);
>>   	spin_unlock_irqrestore(&lldev->lock, irqflags);
>>
>> -	return rc;
>> +	return 0;
>>   }
>>
>>   bool hidma_ll_isenabled(struct hidma_lldev *lldev)
>
> Seems rather pointless, what about 'static void ...' and dropping the
> return statement?
>
>
> Daniel K.
>

Yes, that's what I ended up doing. rc was forgotten there because I had 
to restructure code to use the issue_pending API.

-- 
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a 
Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web