* [PATCH] dma: fix returnvar.cocci warnings
@ 2015-11-08 7:45 Julia Lawall
2015-11-08 21:15 ` Andy Shevchenko
2015-11-08 21:39 ` Daniel K.
0 siblings, 2 replies; 7+ messages in thread
From: Julia Lawall @ 2015-11-08 7:45 UTC (permalink / raw)
Cc: agross, kbuild-all, dmaengine, timur, cov, jcm, linux-arm-msm,
linux-arm-kernel, Sinan Kaya, Rob Herring, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala, Vinod Koul, Dan Williams,
devicetree, linux-kernel
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)
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] dma: fix returnvar.cocci warnings 2015-11-08 7:45 [PATCH] dma: fix returnvar.cocci warnings Julia Lawall @ 2015-11-08 21:15 ` Andy Shevchenko 2015-11-08 21:17 ` Julia Lawall ` (2 more replies) 2015-11-08 21:39 ` Daniel K. 1 sibling, 3 replies; 7+ messages in thread From: Andy Shevchenko @ 2015-11-08 21:15 UTC (permalink / raw) To: Julia Lawall Cc: Sinan Kaya, Andy Gross, kbuild-all, dmaengine, timur, cov, jcm, linux-arm-msm, linux-arm Mailing List, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Vinod Koul, Dan Williams, devicetree, linux-kernel@vger.kernel.org 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: fix returnvar.cocci warnings 2015-11-08 21:15 ` Andy Shevchenko @ 2015-11-08 21:17 ` Julia Lawall 2015-11-08 21:19 ` Julia Lawall 2015-11-08 21:19 ` Timur Tabi 2 siblings, 0 replies; 7+ messages in thread From: Julia Lawall @ 2015-11-08 21:17 UTC (permalink / raw) To: Andy Shevchenko Cc: Julia Lawall, Sinan Kaya, Andy Gross, kbuild-all, dmaengine, timur, cov, jcm, linux-arm-msm, linux-arm Mailing List, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Vinod Koul, Dan Williams, devicetree, linux-kernel@vger.kernel.org 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 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: fix returnvar.cocci warnings 2015-11-08 21:15 ` Andy Shevchenko 2015-11-08 21:17 ` Julia Lawall @ 2015-11-08 21:19 ` Julia Lawall 2015-11-08 21:19 ` Timur Tabi 2 siblings, 0 replies; 7+ messages in thread From: Julia Lawall @ 2015-11-08 21:19 UTC (permalink / raw) To: Andy Shevchenko Cc: Julia Lawall, Sinan Kaya, Andy Gross, kbuild-all, dmaengine, timur, cov, jcm, linux-arm-msm, linux-arm Mailing List, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Vinod Koul, Dan Williams, devicetree, linux-kernel@vger.kernel.org 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 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: fix returnvar.cocci warnings 2015-11-08 21:15 ` Andy Shevchenko 2015-11-08 21:17 ` Julia Lawall 2015-11-08 21:19 ` Julia Lawall @ 2015-11-08 21:19 ` Timur Tabi 2 siblings, 0 replies; 7+ messages in thread From: Timur Tabi @ 2015-11-08 21:19 UTC (permalink / raw) To: Andy Shevchenko, Julia Lawall Cc: Sinan Kaya, Andy Gross, kbuild-all, dmaengine, cov, jcm, linux-arm-msm, linux-arm Mailing List, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Vinod Koul, Dan Williams, devicetree, linux-kernel@vger.kernel.org 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. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: fix returnvar.cocci warnings 2015-11-08 7:45 [PATCH] dma: fix returnvar.cocci warnings Julia Lawall 2015-11-08 21:15 ` Andy Shevchenko @ 2015-11-08 21:39 ` Daniel K. 2015-11-08 22:00 ` Sinan Kaya 1 sibling, 1 reply; 7+ messages in thread From: Daniel K. @ 2015-11-08 21:39 UTC (permalink / raw) To: Julia Lawall, Sinan Kaya Cc: linux-arm-kernel, Mark Rutland, Pawel Moll, Ian Campbell, Vinod Koul, jcm, timur, Kumar Gala, linux-kernel, devicetree, Rob Herring, cov, agross, dmaengine, Dan Williams, linux-arm-msm, kbuild-all 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. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: fix returnvar.cocci warnings 2015-11-08 21:39 ` Daniel K. @ 2015-11-08 22:00 ` Sinan Kaya 0 siblings, 0 replies; 7+ messages in thread From: Sinan Kaya @ 2015-11-08 22:00 UTC (permalink / raw) To: Daniel K., Julia Lawall Cc: agross, kbuild-all, dmaengine, timur, cov, jcm, linux-arm-msm, linux-arm-kernel, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Vinod Koul, Dan Williams, devicetree, linux-kernel 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-11-08 22:00 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-11-08 7:45 [PATCH] dma: fix returnvar.cocci warnings Julia Lawall 2015-11-08 21:15 ` Andy Shevchenko 2015-11-08 21:17 ` Julia Lawall 2015-11-08 21:19 ` Julia Lawall 2015-11-08 21:19 ` Timur Tabi 2015-11-08 21:39 ` Daniel K. 2015-11-08 22:00 ` Sinan Kaya
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).