mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: kernel-janitors@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 8/25] drivers/dma: fix error return code
Date: Mon, 20 Jan 2014 14:58:29 +0530	[thread overview]
Message-ID: <20140120092829.GU26823@intel.com> (raw)
In-Reply-To: <1388357260-4843-9-git-send-email-Julia.Lawall@lip6.fr>

On Sun, Dec 29, 2013 at 11:47:23PM +0100, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Set the return variable to an error code as done elsewhere in the function.
> 
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> (
> if@p1 (\(ret < 0\|ret != 0\))
>  { ... return ret; }
> |
> ret@p1 = 0
> )
> ... when != ret = e1
>     when != &ret
> *if(...)
> {
>   ... when != ret = e2
>       when forall
>  return ret;
> }
> 
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Applied, thanks

--
~Vinod
> 
> ---
> Not tested.
> 
>  drivers/dma/cppi41.c      |    4 +++-
>  drivers/dma/ppc4xx/adma.c |    1 +
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
> index c29dacf..c18aebf 100644
> --- a/drivers/dma/cppi41.c
> +++ b/drivers/dma/cppi41.c
> @@ -972,8 +972,10 @@ static int cppi41_dma_probe(struct platform_device *pdev)
>  		goto err_chans;
>  
>  	irq = irq_of_parse_and_map(dev->of_node, 0);
> -	if (!irq)
> +	if (!irq) {
> +		ret = -EINVAL;
>  		goto err_irq;
> +	}
>  
>  	cppi_writel(USBSS_IRQ_PD_COMP, cdd->usbss_mem + USBSS_IRQ_ENABLER);
>  
> diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
> index 8bba298..ce7a8d7 100644
> --- a/drivers/dma/ppc4xx/adma.c
> +++ b/drivers/dma/ppc4xx/adma.c
> @@ -4114,6 +4114,7 @@ static int ppc440spe_adma_probe(struct platform_device *ofdev)
>  	regs = ioremap(res.start, resource_size(&res));
>  	if (!regs) {
>  		dev_err(&ofdev->dev, "failed to ioremap regs!\n");
> +		ret = -ENOMEM;
>  		goto err_regs_alloc;
>  	}
>  
> 

-- 

  reply	other threads:[~2014-01-20 10:30 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-29 22:47 [PATCH 0/25] " Julia Lawall
2013-12-29 22:47 ` [PATCH 1/25] " Julia Lawall
2013-12-29 22:47 ` [PATCH 2/25] rsxx: " Julia Lawall
2013-12-29 22:47 ` [PATCH 3/25] " Julia Lawall
2013-12-29 22:47 ` [PATCH 4/25] UBI: " Julia Lawall
2013-12-31 11:30   ` Richard Weinberger
2014-01-02 15:16   ` Artem Bityutskiy
2013-12-29 22:47 ` [PATCH 5/25] IB/mlx4: " Julia Lawall
2013-12-31  7:52   ` Jack Morgenstein
2013-12-29 22:47 ` [PATCH 6/25] " Julia Lawall
2014-01-03  9:08   ` Jiri Kosina
2013-12-29 22:47 ` [PATCH 7/25] net: " Julia Lawall
2014-01-02  8:31   ` David Miller
2013-12-29 22:47 ` [PATCH 8/25] drivers/dma: " Julia Lawall
2014-01-20  9:28   ` Vinod Koul [this message]
2013-12-29 22:47 ` [PATCH 9/25] " Julia Lawall
2013-12-29 22:47 ` [PATCH 10/25] usb: gadget: " Julia Lawall
2013-12-29 22:47 ` [PATCH 11/25] pcmcia: " Julia Lawall
2013-12-29 22:47 ` [PATCH 12/25] HID: sony: " Julia Lawall
2014-01-02 12:51   ` Jiri Kosina
2013-12-29 22:47 ` [PATCH 13/25] hamradio: 6pack: " Julia Lawall
2014-01-02  8:31   ` David Miller
2013-12-29 22:47 ` [PATCH 14/25] RDMA/amso1100: " Julia Lawall
2013-12-29 22:47 ` [PATCH 17/25] " Julia Lawall
2013-12-29 22:47 ` [PATCH 16/25] block: " Julia Lawall
2013-12-29 22:47 ` [PATCH 15/25] " Julia Lawall
2013-12-29 22:47 ` [PATCH 18/25] mtd: nand: " Julia Lawall
2013-12-29 22:47 ` [PATCH 19/25] " Julia Lawall
2013-12-29 21:58   ` Geert Uytterhoeven
2013-12-29 22:47 ` [PATCH 20/25] " Julia Lawall
2013-12-29 22:47 ` [PATCH 21/25] fujitsu-laptop: " Julia Lawall
2013-12-31 13:05   ` Jonathan Woithe
2013-12-29 22:47 ` [PATCH 22/25] RDMA/nes: " Julia Lawall
2013-12-29 22:47 ` [PATCH 23/25] thermal: exynos: " Julia Lawall
2013-12-30  1:31   ` Jingoo Han
2014-01-02  1:55   ` Zhang Rui
2013-12-29 22:47 ` [PATCH 24/25] " Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140120092829.GU26823@intel.com \
    --to=vinod.koul@intel.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome