All of lore.kernel.org
 help / color / mirror / Atom feed
From: lars@metafoo.de (Lars-Peter Clausen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RESEND v5 1/2] dma: imx-dma: Add oftree support
Date: Thu, 18 Apr 2013 17:14:37 +0200	[thread overview]
Message-ID: <51700DDD.1060801@metafoo.de> (raw)
In-Reply-To: <1366291298-30004-2-git-send-email-mpa@pengutronix.de>

Hi,

On 04/18/2013 03:21 PM, Markus Pargmann wrote:
[...]
> +static struct dma_chan *imxdma_xlate(struct of_phandle_args *dma_spec,
> +						struct of_dma *ofdma)
> +{
> +	int count = dma_spec->args_count;
> +	struct imxdma_engine *imxdma = ofdma->of_dma_data;
> +	struct imxdma_filter_data fdata = {
> +		.imxdma = imxdma,
> +		.request = *(unsigned *)&dma_spec->args[0],

This cast looks rather bogus and shouldn't be necessary.

> +	};
> +
> +	if (count != 1)
> +		return NULL;

I think you need to check count before you access dma_spec->args[0]

> +
> +	return dma_request_channel(imxdma->dma_device.cap_mask,
> +					imxdma_filter_fn, &fdata);
> +}
> +
[...]

WARNING: multiple messages have this Message-ID (diff)
From: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
To: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	Dan Williams <djbw-b10kYP2dOMg@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH RESEND v5 1/2] dma: imx-dma: Add oftree support
Date: Thu, 18 Apr 2013 17:14:37 +0200	[thread overview]
Message-ID: <51700DDD.1060801@metafoo.de> (raw)
In-Reply-To: <1366291298-30004-2-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

Hi,

On 04/18/2013 03:21 PM, Markus Pargmann wrote:
[...]
> +static struct dma_chan *imxdma_xlate(struct of_phandle_args *dma_spec,
> +						struct of_dma *ofdma)
> +{
> +	int count = dma_spec->args_count;
> +	struct imxdma_engine *imxdma = ofdma->of_dma_data;
> +	struct imxdma_filter_data fdata = {
> +		.imxdma = imxdma,
> +		.request = *(unsigned *)&dma_spec->args[0],

This cast looks rather bogus and shouldn't be necessary.

> +	};
> +
> +	if (count != 1)
> +		return NULL;

I think you need to check count before you access dma_spec->args[0]

> +
> +	return dma_request_channel(imxdma->dma_device.cap_mask,
> +					imxdma_filter_fn, &fdata);
> +}
> +
[...]

  reply	other threads:[~2013-04-18 15:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 13:21 [PATCH RESEND v5 0/2] dma: imx-dma: OFTree support Markus Pargmann
2013-04-18 13:21 ` Markus Pargmann
2013-04-18 13:21 ` [PATCH RESEND v5 1/2] dma: imx-dma: Add oftree support Markus Pargmann
2013-04-18 13:21   ` Markus Pargmann
2013-04-18 15:14   ` Lars-Peter Clausen [this message]
2013-04-18 15:14     ` Lars-Peter Clausen
2013-04-18 16:02     ` Markus Pargmann
2013-04-18 16:02       ` Markus Pargmann
2013-04-18 13:21 ` [PATCH RESEND v5 2/2] DMA: imx-dma: imxdma->dev used uninitialized Markus Pargmann
2013-04-18 13:21   ` Markus Pargmann
2013-04-18 14:44 ` [PATCH RESEND v5 0/2] dma: imx-dma: OFTree support Shawn Guo
2013-04-18 14:44   ` Shawn Guo
2013-04-21  8:51   ` Markus Pargmann
2013-04-21  8:51     ` Markus Pargmann

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=51700DDD.1060801@metafoo.de \
    --to=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.