[PATCH 05/23] drm_dma.c: drm_alloc + memset to drm_zalloc

From: m . kozlowski
Date: Mon Aug 27 2007 - 17:16:06 EST


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@xxxxxxxxxx>

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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/