lkml.org 
[lkml]   [2007]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 05/23] drm_dma.c: drm_alloc + memset to drm_zalloc
This patch does the conversion of drm_alloc + memset to drm_zalloc.
The memset in loop is also superfluous and can be removed.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>

drivers/char/drm/drm_dma.c | 4624 -> 4475 (-149 bytes)
drivers/char/drm/drm_dma.o | 104277 -> 103917 (-360 bytes)

drivers/char/drm/drm_dma.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)

--- linux-2.6.23-rc3-mm1.orig/drivers/char/drm/drm_dma.c
+++ linux-2.6.23-rc3-mm1/drivers/char/drm/drm_dma.c
@@ -45,17 +45,10 @@
*/
int drm_dma_setup(struct drm_device *dev)
{
- int i;
-
- dev->dma = drm_alloc(sizeof(*dev->dma), DRM_MEM_DRIVER);
+ dev->dma = drm_zalloc(sizeof(*dev->dma), DRM_MEM_DRIVER);
if (!dev->dma)
return -ENOMEM;

- memset(dev->dma, 0, sizeof(*dev->dma));
-
- for (i = 0; i <= DRM_MAX_ORDER; i++)
- memset(&dev->dma->bufs[i], 0, sizeof(dev->dma->bufs[0]));
-
return 0;
}

--
-
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/
\
 
 \ /
  Last update: 2007-08-27 23:19    [W:0.156 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site