[<prev] [next>] [day] [month] [year] [list]
Message-ID: <7F38996F7185A24AB9071ED4950AD8C101902E66@swsmsx413.ger.corp.intel.com>
Date: Tue, 13 May 2008 14:04:34 +0100
From: "Sosnowski, Maciej" <maciej.sosnowski@...el.com>
To: "Christophe Jaillet" <christophe.jaillet@...adoo.fr>
Cc: "linux" <linux-kernel@...r.kernel.org>,
"Williams, Dan J" <dan.j.williams@...el.com>
Subject: RE: [PATCH 1/1] dma:
Christophe Jaillet wrote:
> From: Christophe Jaillet <christophe.jaillet@...adoo.fr>
>
> Hi, here is a patch against linux/drivers/dma/iop-adma.c which :
>
> 1) Remove an explicit memset(.., 0, ...) to a variable allocated with
> kzalloc (i.e. 'dest').
>
> 2) Allocate 'src' with kmalloc instead of kzalloc as all elements of the
> 'src' buffer are initialized in a 'for(...)' loop just after.
>
> 3) remove useless 'sizeof(u8)', which always returns 1, when computing the
> size of the memory to be allocated.
>
>
> Note: this patch is based on 'linux-2.6.25.tar.bz2'
>
> Signed-off-by: Christophe Jaillet <christophe.jaillet@...adoo.fr>
>
> ---
>
> --- linux/drivers/dma/iop-adma.c 2008-04-17 04:49:44.000000000 +0200
> +++ linux/drivers/dma/iop-adma.c.cj 2008-05-12 22:39:14.000000000 +0200
> @@ -825,10 +825,10 @@ static int __devinit iop_adma_memcpy_sel
>
> dev_dbg(device->common.dev, "%s\n", __func__);
>
> - src = kzalloc(sizeof(u8) * IOP_ADMA_TEST_SIZE, GFP_KERNEL);
> + src = kmalloc(IOP_ADMA_TEST_SIZE, GFP_KERNEL);
> if (!src)
> return -ENOMEM;
> - dest = kzalloc(sizeof(u8) * IOP_ADMA_TEST_SIZE, GFP_KERNEL);
> + dest = kzalloc(IOP_ADMA_TEST_SIZE, GFP_KERNEL);
> if (!dest) {
> kfree(src);
> return -ENOMEM;
> @@ -838,8 +838,6 @@ static int __devinit iop_adma_memcpy_sel
> for (i = 0; i < IOP_ADMA_TEST_SIZE; i++)
> ((u8 *) src)[i] = (u8)i;
>
> - memset(dest, 0, IOP_ADMA_TEST_SIZE);
> -
> /* Start copy, using first DMA channel */
> dma_chan = container_of(device->common.channels.next,
> struct dma_chan,
Acked-by: Maciej Sosnowski <maciej.sosnowski@...el.com>
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
z siedziba w Gdansku
ul. Slowackiego 173
80-298 Gdansk
Sad Rejonowy Gdansk Polnoc w Gdansku,
VII Wydzial Gospodarczy Krajowego Rejestru Sadowego,
numer KRS 101882
NIP 957-07-52-316
Kapital zakladowy 200.000 zl
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists