public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH 1/1] dma:
       [not found] <20080512205052.C1DFB7000085@mwinf2b01.orange.fr>
@ 2008-05-13 13:04 ` Sosnowski, Maciej
  2008-05-13 22:55 ` Dan Williams
  1 sibling, 0 replies; 2+ messages in thread
From: Sosnowski, Maciej @ 2008-05-13 13:04 UTC (permalink / raw)
  To: Christophe Jaillet; +Cc: linux, Williams, Dan J

Christophe Jaillet wrote:
> From: Christophe Jaillet <christophe.jaillet@wanadoo.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@wanadoo.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@intel.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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] dma:
       [not found] <20080512205052.C1DFB7000085@mwinf2b01.orange.fr>
  2008-05-13 13:04 ` [PATCH 1/1] dma: Sosnowski, Maciej
@ 2008-05-13 22:55 ` Dan Williams
  1 sibling, 0 replies; 2+ messages in thread
From: Dan Williams @ 2008-05-13 22:55 UTC (permalink / raw)
  To: Christophe Jaillet; +Cc: linux, Sosnowski, Maciej


On Mon, 2008-05-12 at 13:50 -0700, Christophe Jaillet wrote:
> From: Christophe Jaillet <christophe.jaillet@wanadoo.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@wanadoo.fr>

Thanks, applied.

--
Dan


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-13 22:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080512205052.C1DFB7000085@mwinf2b01.orange.fr>
2008-05-13 13:04 ` [PATCH 1/1] dma: Sosnowski, Maciej
2008-05-13 22:55 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox